Fixed bug with bad initial loading into store instead of auth
This commit is contained in:
+4
-1
@@ -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", () => {
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
<template />
|
||||
|
||||
<script setup lang="ts">
|
||||
const router = useRouter();
|
||||
router.replace("/store");
|
||||
</script>
|
||||
|
||||
@@ -41,9 +41,12 @@ pub struct Database {
|
||||
pub base_url: String,
|
||||
pub games: DatabaseGames,
|
||||
}
|
||||
pub static DATA_ROOT_DIR: LazyLock<PathBuf> =
|
||||
LazyLock::new(|| BaseDirs::new().unwrap().data_dir().join("drop"));
|
||||
|
||||
pub type DatabaseInterface =
|
||||
rustbreak::Database<Database, rustbreak::backend::PathBackend, Bincode>;
|
||||
|
||||
pub trait DatabaseImpls {
|
||||
fn set_up_database() -> DatabaseInterface;
|
||||
fn database_is_set_up(&self) -> bool;
|
||||
@@ -82,6 +85,4 @@ impl DatabaseImpls for DatabaseInterface {
|
||||
let handle = self.borrow_data().unwrap();
|
||||
Url::parse(&handle.base_url).unwrap()
|
||||
}
|
||||
}
|
||||
pub static DATA_ROOT_DIR: LazyLock<PathBuf> =
|
||||
LazyLock::new(|| BaseDirs::new().unwrap().data_dir().join("drop"));
|
||||
}
|
||||
Reference in New Issue
Block a user