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() { mounted() {
this.getCourseMeta().then(data => this.courseMeta = data) if(lms.store.checkLogin()) this.getCourseMeta().then(data => this.courseMeta = data)
}, },
components: { components: {
AButton AButton

View File

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

View File

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

View File

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