Trent Larson
3 months ago
6 changed files with 14 additions and 38 deletions
@ -1,20 +0,0 @@ |
|||||
// @ts-check
|
|
||||
import { defineStore } from "pinia"; |
|
||||
|
|
||||
export const useAppStore = defineStore({ |
|
||||
id: "app", |
|
||||
state: () => ({ |
|
||||
_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); |
|
||||
}, |
|
||||
}, |
|
||||
}); |
|
Loading…
Reference in new issue