From cbb7c7ff2396abea32b3b9106e571f4ad8b4a8f1 Mon Sep 17 00:00:00 2001 From: scmmishra Date: Mon, 26 Nov 2018 11:59:12 +0530 Subject: [PATCH] ui fixes --- erpnext/public/js/education/lms/components/CourseCard.vue | 6 ++++-- erpnext/public/js/education/lms/routes.js | 7 ++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/erpnext/public/js/education/lms/components/CourseCard.vue b/erpnext/public/js/education/lms/components/CourseCard.vue index e9b9e07f922..494c5e59afe 100644 --- a/erpnext/public/js/education/lms/components/CourseCard.vue +++ b/erpnext/public/js/education/lms/components/CourseCard.vue @@ -38,12 +38,11 @@ export default { name: "CourseCard", data() { return { - isLogin: lms.store.isLogin, courseMeta: {} } }, mounted() { - if(this.isLogin) this.getCourseMeta().then(data => this.courseMeta = data) + this.getCourseMeta().then(data => this.courseMeta = data) }, components: { AButton @@ -65,6 +64,9 @@ export default { else { return " hidden" } + }, + isLogin() { + return lms.store.checkLogin() } }, methods: { diff --git a/erpnext/public/js/education/lms/routes.js b/erpnext/public/js/education/lms/routes.js index 921f8ec40e6..e6eb002e166 100644 --- a/erpnext/public/js/education/lms/routes.js +++ b/erpnext/public/js/education/lms/routes.js @@ -12,7 +12,12 @@ const routes = [ component: ContentPage, props: true, beforeEnter: (to, from, next) => { - if(!lms.store.isLogin) next({name: 'home'}) + if(!lms.store.isLogin){ + next({name: 'home'}) + } + else { + next() + } } }, {