From 02420bd4bae4ab3d0c82bfa205341caefbc76a06 Mon Sep 17 00:00:00 2001 From: scmmishra Date: Fri, 30 Nov 2018 12:47:18 +0530 Subject: [PATCH] Client side improvements --- .../public/js/education/lms/components/CourseCard.vue | 2 +- erpnext/public/js/education/lms/lms.js | 1 - erpnext/public/js/education/lms/lmsRoot.vue | 3 --- erpnext/public/js/education/lms/routes.js | 10 +++++++++- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/erpnext/public/js/education/lms/components/CourseCard.vue b/erpnext/public/js/education/lms/components/CourseCard.vue index 7839aa6a0b3..4718347ba1d 100644 --- a/erpnext/public/js/education/lms/components/CourseCard.vue +++ b/erpnext/public/js/education/lms/components/CourseCard.vue @@ -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 diff --git a/erpnext/public/js/education/lms/lms.js b/erpnext/public/js/education/lms/lms.js index 3d2bd50dcd7..a98b86299f7 100644 --- a/erpnext/public/js/education/lms/lms.js +++ b/erpnext/public/js/education/lms/lms.js @@ -70,6 +70,5 @@ frappe.ready(() => { if(lms.store.isLogin) lms.store.updateState() } }); - lms.debug = true }) \ No newline at end of file diff --git a/erpnext/public/js/education/lms/lmsRoot.vue b/erpnext/public/js/education/lms/lmsRoot.vue index 2af74abd8d5..3a6cb801712 100644 --- a/erpnext/public/js/education/lms/lmsRoot.vue +++ b/erpnext/public/js/education/lms/lmsRoot.vue @@ -6,8 +6,5 @@ \ No newline at end of file diff --git a/erpnext/public/js/education/lms/routes.js b/erpnext/public/js/education/lms/routes.js index 5ebb1e660bd..020c5974e63 100644 --- a/erpnext/public/js/education/lms/routes.js +++ b/erpnext/public/js/education/lms/routes.js @@ -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() + } + } } ];