Selaa lähdekoodia

fix: 修改bug

bill 1 vuosi sitten
vanhempi
commit
f5b694b8f7
2 muutettua tiedostoa jossa 6 lisäystä ja 1 poistoa
  1. 5 1
      src/store/project.ts
  2. 1 0
      src/views/project/detailed.vue

+ 5 - 1
src/store/project.ts

@@ -89,7 +89,11 @@ export const useProject = defineStore('project', {
   },
   actions: {
     async setRoles(id: Project['projectId']) {
-      this.roleMenus = transformNames(await fetchProjectRoleOptions(id))
+      if (id) {
+        this.roleMenus = transformNames(await fetchProjectRoleOptions(id))
+      } else {
+        this.roleMenus = DefaultMenus
+      }
     },
     async setCurrent(id: Project['projectId']) {
       this.current = await fetchProject(id)

+ 1 - 0
src/views/project/detailed.vue

@@ -128,6 +128,7 @@ onActivated(() => {
   }, 1000)
 })
 onDeactivated(() => {
+  projectStore.setRoles(null)
   clearInterval(interval)
 })