Adding new routing logic ... broken for the moment

This commit is contained in:
Matthew Aaron Raymer
2022-12-07 17:59:37 +08:00
parent ed23317b0f
commit 39f2d73007
3 changed files with 23 additions and 11 deletions

View File

@@ -2,12 +2,17 @@
import { defineStore } from "pinia";
export const useAppStore = defineStore({
id: "account",
id: "app",
state: () => ({
condition: JSON.parse(
typeof localStorage["app_condition"] == "undefined"
typeof localStorage["condition"] == "undefined"
? "uninitialized"
: localStorage["app_condition"]
: localStorage["condition"]
),
lastView: JSON.parse(
typeof localStorage["lastView"] == "undefined"
? "/start"
: localStorage["lastView"]
),
}),
getters: {
@@ -15,7 +20,7 @@ export const useAppStore = defineStore({
},
actions: {
reset() {
localStorage.removeItem("app_condition");
localStorage.removeItem("condition");
},
},
});