You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
477 B
20 lines
477 B
// @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);
|
|
},
|
|
},
|
|
});
|
|
|