Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix: wrap all workspaces with Suspense (#2477)

Himself6541a3d6f62f4f
diff --git a/apps/web/src/layouts/workspace-layout.tsx b/apps/web/src/layouts/workspace-layout.tsx
index 232ccd8b40..8936c57267 100644
--- a/apps/web/src/layouts/workspace-layout.tsx
+++ b/apps/web/src/layouts/workspace-layout.tsx
@@ -243,12 +243,15 @@ export const WorkspaceLayout: FC<PropsWithChildren> =
(meta && WorkspaceAdapters[meta.flavour].UI.Provider) ?? DefaultProvider;
return (
<>
- {/* fixme(himself65): don't re-render whole modals */}
- <AllWorkspaceContext>
- <CurrentWorkspaceContext>
- <ModalProvider key={currentWorkspaceId} />
- </CurrentWorkspaceContext>
- </AllWorkspaceContext>
+ {/* load all workspaces is costly, do not block the whole UI */}
+ <Suspense fallback={null}>
+ <AllWorkspaceContext>
+ <CurrentWorkspaceContext>
+ {/* fixme(himself65): don't re-render whole modals */}
+ <ModalProvider key={currentWorkspaceId} />
+ </CurrentWorkspaceContext>
+ </AllWorkspaceContext>
+ </Suspense>
<CurrentWorkspaceContext>
<Suspense fallback={<WorkspaceFallback />}>
<Provider>