mirror of
https://github.com/aykhans/slash-e.git
synced 2025-07-04 12:26:19 +00:00
chore: fix initial state
This commit is contained in:
@ -11,17 +11,17 @@ interface WorkspaceState {
|
||||
fetchWorkspaceSetting: () => Promise<WorkspaceSetting>;
|
||||
}
|
||||
|
||||
const useWorkspaceStore = create<WorkspaceState>()((set) => ({
|
||||
const useWorkspaceStore = create<WorkspaceState>()((set, get) => ({
|
||||
profile: WorkspaceProfile.fromPartial({}),
|
||||
setting: WorkspaceSetting.fromPartial({}),
|
||||
fetchWorkspaceProfile: async () => {
|
||||
const workspaceProfile = (await workspaceServiceClient.getWorkspaceProfile({})).profile as WorkspaceProfile;
|
||||
set({ profile: workspaceProfile });
|
||||
set({ ...get(), profile: workspaceProfile });
|
||||
return workspaceProfile;
|
||||
},
|
||||
fetchWorkspaceSetting: async () => {
|
||||
const workspaceSetting = (await workspaceServiceClient.getWorkspaceSetting({})).setting as WorkspaceSetting;
|
||||
set({ setting: workspaceSetting });
|
||||
set({ ...get(), setting: workspaceSetting });
|
||||
return workspaceSetting;
|
||||
},
|
||||
}));
|
||||
|
Reference in New Issue
Block a user