mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
fix: bug sweep — profile, mentions, deep links, channel links, doctor page (#480)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -25,6 +25,8 @@ export type UseWorkspacesReturn = {
|
||||
addWorkspace: (workspace: Workspace) => string;
|
||||
removeWorkspace: (id: string) => void;
|
||||
switchWorkspace: (id: string) => void;
|
||||
/** Force the active workspace to re-init (e.g. after a deep-link reconnect). */
|
||||
reconnectWorkspace: () => void;
|
||||
updateWorkspace: (
|
||||
id: string,
|
||||
updates: Partial<Pick<Workspace, "name" | "relayUrl" | "token" | "pubkey">>,
|
||||
@@ -117,15 +119,17 @@ function useWorkspacesInternal(): UseWorkspacesReturn {
|
||||
|
||||
const switchWorkspace = useCallback(
|
||||
(id: string) => {
|
||||
if (id === activeId) {
|
||||
return;
|
||||
}
|
||||
if (id === activeId) return;
|
||||
saveActiveWorkspaceId(id);
|
||||
setActiveId(id);
|
||||
},
|
||||
[activeId],
|
||||
);
|
||||
|
||||
const reconnectWorkspace = useCallback(() => {
|
||||
setReinitKey((k) => k + 1);
|
||||
}, []);
|
||||
|
||||
const updateWorkspace = useCallback(
|
||||
(
|
||||
id: string,
|
||||
@@ -164,6 +168,7 @@ function useWorkspacesInternal(): UseWorkspacesReturn {
|
||||
addWorkspace,
|
||||
removeWorkspace,
|
||||
switchWorkspace,
|
||||
reconnectWorkspace,
|
||||
updateWorkspace,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user