fix
Some checks failed
Deploy / deploy (build, debian, 22) (push) Has been cancelled
Deploy / deploy (build:staging, school, 8822) (push) Has been cancelled

This commit is contained in:
2026-04-01 05:17:53 -06:00
parent 501f314aff
commit 7f0bfd67fa
2 changed files with 14 additions and 13 deletions

View File

@@ -1,9 +1,17 @@
import { useStorage } from "@vueuse/core"
import { ref } from "vue"
import { Tutorial } from "../api"
export const step = useStorage("tutorial-step", 1)
export const tutorialIds = ref<number[]>([])
export async function loadTutorials(): Promise<void> {
tutorialIds.value = await Tutorial.listDisplay()
if (tutorialIds.value.length && !tutorialIds.value.includes(step.value)) {
step.value = tutorialIds.value[0] as number
}
}
export function prevDisabled(): boolean {
const i = tutorialIds.value.indexOf(step.value)
return i <= 0