diff --git a/src/store/app.ts b/src/store/app.ts index 3ab7b8cf2..f3cc0c470 100644 --- a/src/store/app.ts +++ b/src/store/app.ts @@ -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); + }, }, }); diff --git a/src/views/NewEditProjectView.vue b/src/views/NewEditProjectView.vue index 545e3e171..1fffbcdea 100644 --- a/src/views/NewEditProjectView.vue +++ b/src/views/NewEditProjectView.vue @@ -76,6 +76,7 @@ import { db } from "../db"; import { accessToken, SimpleSigner } from "@/libs/crypto"; import * as didJwt from "did-jwt"; import { IIdentifier } from "@veramo/core"; +import { useAppStore } from "@/store/app"; @Options({ components: {}, @@ -133,9 +134,9 @@ export default class NewEditProjectView extends Vue { try { const resp = await this.axios.post(url, payload, { headers }); console.log(resp.status, resp.data); + useAppStore().setProjectId(resp.data); const route = { name: "project", - params: { projectId: resp.data }, }; console.log(route); this.$router.push(route); diff --git a/src/views/ProjectViewView.vue b/src/views/ProjectViewView.vue index a95f248e2..0c6c66932 100644 --- a/src/views/ProjectViewView.vue +++ b/src/views/ProjectViewView.vue @@ -126,6 +126,7 @@