From 2133ed270ef34e0427ee00c8c5be9f442993b295 Mon Sep 17 00:00:00 2001 From: NetMan <13informatyka14@gmail.com> Date: Sat, 8 Mar 2025 23:55:14 +0100 Subject: [PATCH] try to fix examstore value between pages (again), check value again before navigating --- pages/exam.vue | 6 +++++- pages/index.vue | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pages/exam.vue b/pages/exam.vue index a239917..a5e7cbd 100644 --- a/pages/exam.vue +++ b/pages/exam.vue @@ -122,7 +122,11 @@ function endExam() { next(); examStore.setResult(result.value); examStore.setEnd(true); - return navigateTo("/result", { replace: true }); + while (true) { + if (examStore.result == result.value && examStore.end) { + return navigateTo("/result", { replace: true }); + } + } } const questionBasic = computed(() => diff --git a/pages/index.vue b/pages/index.vue index 4d2b213..d95bfb4 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -25,7 +25,11 @@ const examStore = useExamStore(); function setAndGo(category: string) { loading.value = true; examStore.setCategory(category); - return navigateTo("/exam"); + while (true) { + if (examStore.category == category) { + return navigateTo("/exam"); + } + } } @@ -34,6 +38,7 @@ function setAndGo(category: string) {
Test na prawo jazdy

+ {{ examStore }}
Witaj w teście na prawo jazdy, aby rozpocząć, naciśnij jeden z poniższych przycisków: