This commit is contained in:
oneao committed 2026-01-31 17:28:52 +08:00
1 parent 572011017a
commit ff3ee944d5
4 files changed
+215 -98

No files matched your search

+5
View File
@@ -4,6 +4,7 @@ interface SpaceState {
userSpace: UserSpace | null
setUserSpace: (space: UserSpace | null) => void
clear: () => void
inSpace: () => boolean
}
export const useSpaceStore = create<SpaceState>((set, get) => ({
@@ -14,4 +15,8 @@ export const useSpaceStore = create<SpaceState>((set, get) => ({
userSpace: null,
})
},
inSpace: () => {
const userSpace = get().userSpace
return userSpace !== null && userSpace.id !== 0
},
}))