From 9229f4fc92638d9abea0c2c91653b78a9b53277c Mon Sep 17 00:00:00 2001 From: scmmishra Date: Fri, 23 Nov 2018 17:16:33 +0530 Subject: [PATCH] UI fixes --- .../js/education/lms/components/ProgramCard.vue | 2 +- erpnext/public/js/education/lms/lms.js | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/erpnext/public/js/education/lms/components/ProgramCard.vue b/erpnext/public/js/education/lms/components/ProgramCard.vue index 53905aa3534..bbe6ba594e9 100644 --- a/erpnext/public/js/education/lms/components/ProgramCard.vue +++ b/erpnext/public/js/education/lms/components/ProgramCard.vue @@ -45,7 +45,7 @@ export default { program_name: this.program.name, }).then(data => { console.log(data) - lms.store.enrolledPrograms.add(data), + lms.store.updateEnrolledPrograms() this.$router.push(this.programRoute) }) } diff --git a/erpnext/public/js/education/lms/lms.js b/erpnext/public/js/education/lms/lms.js index 8914e7bf768..d45b4effb18 100644 --- a/erpnext/public/js/education/lms/lms.js +++ b/erpnext/public/js/education/lms/lms.js @@ -23,17 +23,19 @@ frappe.ready(() => { updateEnrolledPrograms() { if(this.isLogin) { lms.call("get_program_enrollments").then(data => { - if(data) this.enrolledPrograms = data + this.enrolledPrograms = data }); if (lms.debug) console.log('Updated Enrolled Programs', this.enrolledPrograms) } }, updateEnrolledCourses() { - lms.call("get_all_course_enrollments").then(data => { - if(data) this.enrolledCourses = data - }) - if (lms.debug) console.log('Updated Enrolled Courses', this.enrolledCourses) + if(this.isLogin) { + lms.call("get_all_course_enrollments").then(data => { + this.enrolledCourses = data + }) + if (lms.debug) console.log('Updated Enrolled Courses', this.enrolledCourses) + } }, checkLogin() {