try to fix examstore value between pages again, check value again before navigating

This commit is contained in:
NetMan 2025-03-08 23:58:17 +01:00
parent 26c36e1650
commit 86da74cf11
2 changed files with 10 additions and 2 deletions

View file

@ -122,8 +122,12 @@ function endExam() {
next(); next();
examStore.setResult(result.value); examStore.setResult(result.value);
examStore.setEnd(true); examStore.setEnd(true);
while (true) {
if (examStore.result == result.value && examStore.end) {
return navigateTo("/result", { replace: true }); return navigateTo("/result", { replace: true });
} }
}
}
const questionBasic = computed<BasicQuestion | undefined>(() => const questionBasic = computed<BasicQuestion | undefined>(() =>
dataBasic.value?.at(countBasic.value) dataBasic.value?.at(countBasic.value)

View file

@ -25,8 +25,12 @@ const examStore = useExamStore();
function setAndGo(category: string) { function setAndGo(category: string) {
loading.value = true; loading.value = true;
examStore.setCategory(category); examStore.setCategory(category);
while (true) {
if (examStore.category == category) {
return navigateTo("/exam"); return navigateTo("/exam");
} }
}
}
</script> </script>
<template> <template>