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) {