mirror of
https://github.com/OpenSquawk/OpenSquawk
synced 2026-08-05 17:05:53 +08:00
Stop lesson audio when navigating away
This commit is contained in:
@@ -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 = []
|
||||
|
||||
Reference in New Issue
Block a user