From c8a6c374befde11f41c06b67d4a8a2f1a833ce10 Mon Sep 17 00:00:00 2001
From: Jacob Pierce
Date: Fri, 25 Oct 2024 15:35:45 -0700
Subject: [PATCH] avoid type error in initClassInfo; use KExternalLink to
redirect in authmessage w/ urls
---
kolibri/core/assets/src/views/AuthMessage.vue | 7 +++++--
kolibri/plugins/coach/assets/src/modules/pluginModule.js | 8 +++++---
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/kolibri/core/assets/src/views/AuthMessage.vue b/kolibri/core/assets/src/views/AuthMessage.vue
index 29d5b6c997f..b11465a84ed 100644
--- a/kolibri/core/assets/src/views/AuthMessage.vue
+++ b/kolibri/core/assets/src/views/AuthMessage.vue
@@ -17,9 +17,9 @@
/>
-
@@ -65,6 +65,9 @@
},
computed: {
...mapGetters(['isUserLoggedIn']),
+ rootUrl() {
+ return urls['kolibri:core:redirect_user']();
+ },
detailsText() {
return this.details || this.$tr(this.authorizedRole);
},
diff --git a/kolibri/plugins/coach/assets/src/modules/pluginModule.js b/kolibri/plugins/coach/assets/src/modules/pluginModule.js
index 318c7576c20..db997aef898 100644
--- a/kolibri/plugins/coach/assets/src/modules/pluginModule.js
+++ b/kolibri/plugins/coach/assets/src/modules/pluginModule.js
@@ -114,9 +114,11 @@ export default {
return Promise.all([
// Make sure we load any class list data, so that we know
// whether this user has access to multiple classes or not.
- store
- .dispatch('classSummary/loadClassSummary', classId)
- .then(summary => store.dispatch('setClassList', summary.facility_id)),
+ store.dispatch('classSummary/loadClassSummary', classId).then(summary => {
+ if (summary?.facility_id) {
+ store.dispatch('setClassList', summary?.facility_id);
+ }
+ }),
store.dispatch('coachNotifications/fetchNotificationsForClass', classId),
]).catch(error => {
store.dispatch('handleApiError', { error, reloadOnReconnect: true });