Fixed bug with bad initial loading into store instead of auth

This commit is contained in:
quexeky
2024-10-17 21:14:10 +11:00
parent bf46dec359
commit 3923acf780
3 changed files with 8 additions and 6 deletions

View File

@ -10,6 +10,7 @@ import { invoke } from "@tauri-apps/api/core";
import { AppStatus, type AppState } from "./types.d.ts";
import { listen } from "@tauri-apps/api/event";
import { useAppState } from "./composables/app-state.js";
import {useRouter} from "#vue-router";
const router = useRouter();
@ -22,7 +23,7 @@ router.beforeEach(async () => {
switch (state.value.status) {
case AppStatus.NotConfigured:
router.push("/setup");
router.push({ path: "/setup" }).then(() => {console.log("Pushed Setup")});
break;
case AppStatus.SignedOut:
router.push("/auth");
@ -30,6 +31,8 @@ switch (state.value.status) {
case AppStatus.SignedInNeedsReauth:
router.push("/auth/signedout");
break;
default:
router.push("/store");
}
listen("auth/processing", () => {