Skip to content

Commit 178064f

Browse files
committed
refactor: improve workspace ID handling by adding check for current workspace permissions
1 parent 58db4ed commit 178064f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ui/src/stores/modules/user.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ const useUserStore = defineStore('user', {
103103
})
104104
.filter((id) => id !== null); // 过滤掉无效的ID
105105
if (workspaceManagePermissions && workspaceManagePermissions.length > 0) {
106+
if (workspaceManagePermissions.includes(localStorage.getItem('workspace_id') || 'default')) {
107+
return
108+
}
106109
this.setWorkspaceId(workspaceManagePermissions[0])
107110
}
108111
},

0 commit comments

Comments
 (0)