Stop lesson audio when navigating away

This commit is contained in:
Remi
2025-09-22 09:06:41 +02:00
committed by itsrubberduck
parent 7561e9900c
commit fd2880fdef

View File

@@ -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 = []