diff --git a/src/store/app.ts b/src/store/app.ts index f3cc0c4..0aefd7e 100644 --- a/src/store/app.ts +++ b/src/store/app.ts @@ -28,7 +28,7 @@ export const useAppStore = defineStore({ setCondition(newCondition: string) { localStorage.setItem("condition", newCondition); }, - setProjectId(newProjectId: string) { + async setProjectId(newProjectId: string) { localStorage.setItem("projectId", newProjectId); }, }, diff --git a/src/views/NewEditProjectView.vue b/src/views/NewEditProjectView.vue index 1fffbcd..92d4b39 100644 --- a/src/views/NewEditProjectView.vue +++ b/src/views/NewEditProjectView.vue @@ -135,11 +135,19 @@ export default class NewEditProjectView extends Vue { const resp = await this.axios.post(url, payload, { headers }); console.log(resp.status, resp.data); useAppStore().setProjectId(resp.data); - const route = { - name: "project", - }; - console.log(route); - this.$router.push(route); + console.log("TEST", useAppStore().projectId); + setTimeout( + function (that: Vue) { + console.log("THAT:", localStorage.getItem("projectId")); + const route = { + name: "project", + }; + console.log(route); + that.$router.push(route); + }, + 2000, + this + ); } catch (error) { console.log(error); } diff --git a/src/views/ProjectViewView.vue b/src/views/ProjectViewView.vue index 0c6c669..1c7ea5c 100644 --- a/src/views/ProjectViewView.vue +++ b/src/views/ProjectViewView.vue @@ -126,16 +126,47 @@