remove separate storage reference for account check

This commit is contained in:
2023-03-18 17:42:27 -06:00
parent cfeabf05a4
commit 5f3861049e
5 changed files with 74 additions and 56 deletions

View File

@@ -4,10 +4,6 @@ import { defineStore } from "pinia";
export const useAppStore = defineStore({
id: "app",
state: () => ({
_condition:
typeof localStorage["condition"] == "undefined"
? "uninitialized"
: localStorage["condition"],
_lastView:
typeof localStorage["lastView"] == "undefined"
? "/start"
@@ -18,16 +14,9 @@ export const useAppStore = defineStore({
: localStorage.getItem("projectId"),
}),
getters: {
condition: (state) => state._condition,
projectId: (state): string => state._projectId as string,
},
actions: {
reset() {
localStorage.removeItem("condition");
},
setCondition(newCondition: string) {
localStorage.setItem("condition", newCondition);
},
async setProjectId(newProjectId: string) {
localStorage.setItem("projectId", newProjectId);
},