diff --git a/client/src/App.vue b/client/src/App.vue index 916e8ce3..590e001d 100644 --- a/client/src/App.vue +++ b/client/src/App.vue @@ -3,7 +3,7 @@ - + @@ -15,12 +15,19 @@ import log from "loglevel"; import AppFooter from "@/components/AppFooter.vue"; import MainNavigationBar from "@/components/header/MainNavigationBar.vue"; -import { onMounted } from "vue"; +import eventBus from "@/utils/eventBus"; +import { onMounted, ref } from "vue"; + +const componentKey = ref(1); log.debug("App created"); onMounted(() => { log.debug("App mounted"); + + eventBus.on("switchedCourseSession", () => { + componentKey.value++; + }); }); diff --git a/client/src/services/learningPath.ts b/client/src/services/learningPath.ts index a271a7a9..be7c3df1 100644 --- a/client/src/services/learningPath.ts +++ b/client/src/services/learningPath.ts @@ -102,6 +102,7 @@ export class LearningPath implements WagtailLearningPath { } if (userId) { + // TODO this might become a memory leak without unbinding... eventBus.on("switchedCourseSession", (courseSession) => { log.debug("handle switchedCourseSession", courseSession); this.reloadCompletionData();