Skip to content

Commit 76c8d9a

Browse files
committed
Fixed bug with bad initial loading into store instead of auth
1 parent a423e00 commit 76c8d9a

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

app.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { invoke } from "@tauri-apps/api/core";
1010
import { AppStatus, type AppState } from "./types.d.ts";
1111
import { listen } from "@tauri-apps/api/event";
1212
import { useAppState } from "./composables/app-state.js";
13+
import {useRouter} from "#vue-router";
1314
1415
const router = useRouter();
1516
@@ -22,14 +23,16 @@ router.beforeEach(async () => {
2223
2324
switch (state.value.status) {
2425
case AppStatus.NotConfigured:
25-
router.push("/setup");
26+
router.push({ path: "/setup" }).then(() => {console.log("Pushed Setup")});
2627
break;
2728
case AppStatus.SignedOut:
2829
router.push("/auth");
2930
break;
3031
case AppStatus.SignedInNeedsReauth:
3132
router.push("/auth/signedout");
3233
break;
34+
default:
35+
router.push("/store");
3336
}
3437
3538
listen("auth/processing", () => {

pages/index.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
<template />
22

33
<script setup lang="ts">
4-
const router = useRouter();
5-
router.replace("/store");
64
</script>

src-tauri/src/db.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,12 @@ pub struct Database {
4141
pub base_url: String,
4242
pub games: DatabaseGames,
4343
}
44+
pub static DATA_ROOT_DIR: LazyLock<PathBuf> =
45+
LazyLock::new(|| BaseDirs::new().unwrap().data_dir().join("drop"));
4446

4547
pub type DatabaseInterface =
4648
rustbreak::Database<Database, rustbreak::backend::PathBackend, Bincode>;
49+
4750
pub trait DatabaseImpls {
4851
fn set_up_database() -> DatabaseInterface;
4952
fn database_is_set_up(&self) -> bool;
@@ -82,6 +85,4 @@ impl DatabaseImpls for DatabaseInterface {
8285
let handle = self.borrow_data().unwrap();
8386
Url::parse(&handle.base_url).unwrap()
8487
}
85-
}
86-
pub static DATA_ROOT_DIR: LazyLock<PathBuf> =
87-
LazyLock::new(|| BaseDirs::new().unwrap().data_dir().join("drop"));
88+
}

0 commit comments

Comments
 (0)