MCPcopy
hub / github.com/msgbyte/tianji / changeUserCurrentWorkspace

Function changeUserCurrentWorkspace

src/client/store/user.ts:69–82  ·  view source on GitHub ↗
(currentWorkspaceId: string)

Source from the content-addressed store, hash-verified

67}
68
69export 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
84export function useCurrentWorkspaceSafe() {
85 const currentWorkspace = useUserStore((state) => {

Callers 1

Calls 1

createSocketIOClientFunction · 0.90

Tested by

no test coverage detected