// @ts-check import { defineStore } from "pinia"; export const useAppStore = defineStore({ id: "app", state: () => ({ _lastView: typeof localStorage["lastView"] == "undefined" ? "/start" : localStorage["lastView"], _projectId: typeof localStorage.getItem("projectId") === "undefined" ? "" : localStorage.getItem("projectId"), }), getters: { projectId: (state): string => state._projectId as string, }, actions: { async setProjectId(newProjectId: string) { localStorage.setItem("projectId", newProjectId); }, }, });