forked from jsnbuchanan/crowd-funder-for-time-pwa
Subject: workflow for saving of project
* Changed from passing parameters since this isn't supported anymore by Vue * Added new AppStore values for a projectId which are accessible in the ProjectView View
This commit is contained in:
@@ -12,9 +12,14 @@ export const useAppStore = defineStore({
|
||||
typeof localStorage["lastView"] == "undefined"
|
||||
? "/start"
|
||||
: localStorage["lastView"],
|
||||
_projectId:
|
||||
typeof localStorage.getItem("projectId") === "undefined"
|
||||
? ""
|
||||
: localStorage.getItem("projectId"),
|
||||
}),
|
||||
getters: {
|
||||
condition: (state) => state._condition,
|
||||
projectId: (state): string => state._projectId as string,
|
||||
},
|
||||
actions: {
|
||||
reset() {
|
||||
@@ -23,5 +28,8 @@ export const useAppStore = defineStore({
|
||||
setCondition(newCondition: string) {
|
||||
localStorage.setItem("condition", newCondition);
|
||||
},
|
||||
setProjectId(newProjectId: string) {
|
||||
localStorage.setItem("projectId", newProjectId);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user