From fd2880fdef9ad880f4e701c2cf8c3b8fec772243 Mon Sep 17 00:00:00 2001 From: Remi <73385395+itsrubberduck@users.noreply.github.com> Date: Mon, 22 Sep 2025 09:06:41 +0200 Subject: [PATCH] Stop lesson audio when navigating away --- app/pages/learn.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/pages/learn.vue b/app/pages/learn.vue index 0bb2153..d0834b2 100644 --- a/app/pages/learn.vue +++ b/app/pages/learn.vue @@ -2209,6 +2209,7 @@ function startLessonsForCurrent() { } function goToHub() { + stopAudio() panel.value = 'hub' moduleStage.value = 'lessons' current.value = null @@ -2437,7 +2438,9 @@ if (import.meta.client) { } watch([panel, moduleStage], ([panelValue, stage]) => { - if (panelValue !== 'module' || stage !== 'lessons') { + const inLesson = panelValue === 'module' && stage === 'lessons' + if (!inLesson) { + stopAudio() resetModuleOverviewExpansion() } }) @@ -2897,6 +2900,7 @@ watch(activeLesson, lesson => { }) } } else { + stopAudio() scenario.value = null } }) @@ -3130,6 +3134,7 @@ function attemptUnlockModule(modId: string) { } function openModule(id: string, options: { autoStart?: boolean } = {}) { + stopAudio() const module = modules.value.find(item => item.id === id) || null current.value = module manualErrors.value = []