Client side improvements

This commit is contained in:
scmmishra 2018-11-30 12:47:18 +05:30 committed by Aditya Hase
parent edc54cd5f6
commit 02420bd4ba
4 changed files with 10 additions and 6 deletions

View File

@ -42,7 +42,7 @@ export default {
}
},
mounted() {
this.getCourseMeta().then(data => this.courseMeta = data)
if(lms.store.checkLogin()) this.getCourseMeta().then(data => this.courseMeta = data)
},
components: {
AButton

View File

@ -70,6 +70,5 @@ frappe.ready(() => {
if(lms.store.isLogin) lms.store.updateState()
}
});
lms.debug = true
})

View File

@ -6,8 +6,5 @@
<script>
export default {
name: "lmsRoot",
mounted() {
$(document).scrollTop(0)
}
};
</script>

View File

@ -40,7 +40,15 @@ const routes = [
name: 'profile',
path: '/Profile',
component: ProfilePage,
props: true
props: true,
beforeEnter: (to, from, next) => {
if(!lms.store.checkLogin()){
next({name: 'home'})
}
else {
next()
}
}
}
];