diff --git a/app/src/components/game/HintPart.vue b/app/src/components/game/HintPart.vue index f7faaf4..f3487be 100644 --- a/app/src/components/game/HintPart.vue +++ b/app/src/components/game/HintPart.vue @@ -5,13 +5,18 @@ import MarkdownText from '../MarkdownText.vue' const sessionStore = useSession() const current = ref(-1) -watch( - () => sessionStore.session?.hints, - (hints) => { - current.value = hints ? hints.length - 1 : -1 - }, - { deep: true } -) +const length = computed(() => { + console.log(sessionStore.session?.responses) + return sessionStore.session?.responses.length ?? 0 +}) + +const disabled = computed(() => { + return current.value === length.value - 1 +}) + +watch(length, () => { + current.value = length.value - 1 +}) const left = () => { if (current.value > 0) { @@ -20,18 +25,10 @@ const left = () => { } const right = () => { - if (current.value < (sessionStore.session?.hints.length ?? 0) - 1) { + if (current.value < length.value - 1) { current.value += 1 } } - -const length = computed(() => { - return sessionStore.session?.hints.length ?? 0 -}) - -const disabled = computed(() => { - return current.value === length.value - 1 -})