From ce0cefda79d5b64d11911f304938b6f7d8a53d42 Mon Sep 17 00:00:00 2001 From: Remi <73385395+itsrubberduck@users.noreply.github.com> Date: Sat, 20 Sep 2025 09:15:57 +0200 Subject: [PATCH] Adjust next action button for missions --- app/pages/learn.vue | 48 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/app/pages/learn.vue b/app/pages/learn.vue index af3195d..1a599cd 100644 --- a/app/pages/learn.vue +++ b/app/pages/learn.vue @@ -450,8 +450,11 @@
Next: {{ nextLessonMeta.lesson.title }} · Lesson {{ nextLessonMeta.position }} of {{ nextLessonMeta.total }}
+
+ Next mission: {{ nextMissionMeta.module.title }} · Mission {{ nextMissionMeta.position }} of {{ nextMissionMeta.total }} +
- Last lesson in this module. + Last lesson in this mission.
@@ -459,9 +462,14 @@ mdi-dice-5 New scenario -
@@ -981,6 +989,30 @@ const nextLessonMeta = computed(() => { } }) +const nextMissionMeta = computed(() => { + if (!current.value) return null + const currentIndex = modules.value.findIndex(module => module.id === current.value?.id) + if (currentIndex === -1) return null + const total = modules.value.length + for (let idx = currentIndex + 1; idx < modules.value.length; idx++) { + const module = modules.value[idx] + if (isModuleUnlocked(module.id)) { + return { + module, + position: idx + 1, + total + } + } + } + return null +}) + +const nextActionLabel = computed(() => { + if (nextLessonMeta.value) return 'Next lesson' + if (nextMissionMeta.value) return 'Next mission' + return 'Next lesson' +}) + watch(activeLesson, lesson => { if (lesson) { rollScenario(true) @@ -1054,8 +1086,14 @@ function repeatLesson() { function goToNextLesson() { const meta = nextLessonMeta.value - if (!meta) return - activeLesson.value = meta.lesson + if (meta) { + activeLesson.value = meta.lesson + return + } + const nextMission = nextMissionMeta.value + if (nextMission) { + quickContinue(nextMission.module.id) + } } function setActiveFrequency(freq: Frequency) {