From 26db36a5d9a8899db57120bdd17cac735640dec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lev=20Z=20Kir=C3=A1ly?= Date: Wed, 22 Nov 2023 10:29:31 +0100 Subject: [PATCH] Fix bug in initializeScreen #4 --- stores/use-windows-store.ts | 12 +++++++----- vicav-app-api | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) create mode 160000 vicav-app-api diff --git a/stores/use-windows-store.ts b/stores/use-windows-store.ts index 1a937e0..1b3ee77 100644 --- a/stores/use-windows-store.ts +++ b/stores/use-windows-store.ts @@ -107,22 +107,24 @@ export const useWindowsStore = defineStore("windows", () => { const router = useRouter(); const route = useRoute(); - function initializeScreen() { - navigateTo({ + async function initializeScreen() { + await navigateTo({ path: "/", - query: { w: "[]", a: windowsStore.arrangement }, + query: { w: "[]", a: arrangement }, }); } const restoreState = async () => { if (!route.query.w || !route.query.a) { - initializeScreen(); + await initializeScreen(); + return; } // TODO validate with zod let windowState = JSON.parse(route.query.w as string); if (!Array.isArray(windowState)) { - initializeScreen(); + await initializeScreen(); + return; } await nextTick(); diff --git a/vicav-app-api b/vicav-app-api new file mode 160000 index 0000000..7ae96b3 --- /dev/null +++ b/vicav-app-api @@ -0,0 +1 @@ +Subproject commit 7ae96b3af3a70014714e851fcb5d38f3e80decc6