(currentWorkspaceId: string)
| 67 | } |
| 68 | |
| 69 | export function changeUserCurrentWorkspace(currentWorkspaceId: string) { |
| 70 | const currentUserInfo = useUserStore.getState().info; |
| 71 | if (!currentUserInfo) { |
| 72 | return; |
| 73 | } |
| 74 | |
| 75 | useUserStore.setState({ |
| 76 | info: { |
| 77 | ...currentUserInfo, |
| 78 | currentWorkspaceId, |
| 79 | }, |
| 80 | }); |
| 81 | createSocketIOClient(currentWorkspaceId); |
| 82 | } |
| 83 | |
| 84 | export function useCurrentWorkspaceSafe() { |
| 85 | const currentWorkspace = useUserStore((state) => { |
no test coverage detected