From bc16f6012b225532e4e757dff8909e9d9dc9ea35 Mon Sep 17 00:00:00 2001 From: Elia Bieri Date: Tue, 25 Apr 2023 13:06:48 +0200 Subject: [PATCH] Unregister event bus handler --- .../learningPath/selfEvaluationPage/SelfEvaluation.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/client/src/pages/learningPath/selfEvaluationPage/SelfEvaluation.vue b/client/src/pages/learningPath/selfEvaluationPage/SelfEvaluation.vue index 7ac8868b..74d66c01 100644 --- a/client/src/pages/learningPath/selfEvaluationPage/SelfEvaluation.vue +++ b/client/src/pages/learningPath/selfEvaluationPage/SelfEvaluation.vue @@ -8,7 +8,7 @@ import LearningContentContainer from "@/pages/learningPath/learningContentPage/L import LearningContentMultiLayout from "@/pages/learningPath/learningContentPage/layouts/LearningContentMultiLayout.vue"; import { useCourseSessionsStore } from "@/stores/courseSessions"; import eventBus from "@/utils/eventBus"; -import { computed, reactive } from "vue"; +import { computed, onUnmounted, reactive } from "vue"; log.debug("LearningContent.vue setup"); @@ -52,8 +52,14 @@ function handleBack() { } } -eventBus.on("finishedLearningContent", () => { +function handleFinishedLearningContent() { circleStore.closeSelfEvaluation(props.learningUnit); +} + +eventBus.on("finishedLearningContent", handleFinishedLearningContent); + +onUnmounted(() => { + eventBus.off("finishedLearningContent", handleFinishedLearningContent); });