refactor: rootWorkspacesMetadataAtom loading logic (#2882)

This commit is contained in:
Alex Yang
2023-06-29 16:48:12 +08:00
committed by GitHub
parent 8a2dac9718
commit 8410d83744
22 changed files with 436 additions and 353 deletions

View File

@@ -52,7 +52,7 @@ export function createAffineGlobalChannel(
// If the workspace is not in the current workspace list, remove it
if (workspaceIndex === -1) {
rootStore.set(rootWorkspacesMetadataAtom, workspaces => {
await rootStore.set(rootWorkspacesMetadataAtom, workspaces => {
const idx = workspaces.findIndex(workspace => workspace.id === id);
workspaces.splice(idx, 1);
return [...workspaces];