try to fix examstore value between pages (again), check value again before navigating
This commit is contained in:
parent
26c36e1650
commit
2133ed270e
2 changed files with 11 additions and 2 deletions
|
@ -122,7 +122,11 @@ 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>(() =>
|
||||||
|
|
|
@ -25,7 +25,11 @@ 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>
|
||||||
|
|
||||||
|
@ -34,6 +38,7 @@ function setAndGo(category: string) {
|
||||||
<div v-if="!loading" class="text-3xl">
|
<div v-if="!loading" class="text-3xl">
|
||||||
<span>Test na prawo jazdy</span>
|
<span>Test na prawo jazdy</span>
|
||||||
<p>
|
<p>
|
||||||
|
{{ examStore }}<br />
|
||||||
Witaj w teście na prawo jazdy, aby rozpocząć, naciśnij jeden z
|
Witaj w teście na prawo jazdy, aby rozpocząć, naciśnij jeden z
|
||||||
poniższych przycisków:
|
poniższych przycisków:
|
||||||
<br />
|
<br />
|
||||||
|
|
Loading…
Add table
Reference in a new issue