(chapterId: string, lessonId: string)
| 31 | } |
| 32 | |
| 33 | function navigateTo(chapterId: string, lessonId: string) { |
| 34 | const found = findLesson(chapterId, lessonId); |
| 35 | if (!found) return; |
| 36 | |
| 37 | currentChapter.value = found.chapter; |
| 38 | currentLesson.value = found.lesson; |
| 39 | window.history.pushState(null, "", `/${chapterId}/${lessonId}`); |
| 40 | } |
| 41 | |
| 42 | function getAdjacentLesson(direction: -1 | 1): Route | null { |
| 43 | if (!currentChapter.value || !currentLesson.value) return null; |