mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-11-23 13:53:47 +03:00
fix: wrap all workspaces with Suspense (#2477)
This commit is contained in:
parent
752bc9ca0e
commit
41a3d6f62f
@ -243,12 +243,15 @@ export const WorkspaceLayout: FC<PropsWithChildren> =
|
|||||||
(meta && WorkspaceAdapters[meta.flavour].UI.Provider) ?? DefaultProvider;
|
(meta && WorkspaceAdapters[meta.flavour].UI.Provider) ?? DefaultProvider;
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* fixme(himself65): don't re-render whole modals */}
|
{/* load all workspaces is costly, do not block the whole UI */}
|
||||||
<AllWorkspaceContext>
|
<Suspense fallback={null}>
|
||||||
<CurrentWorkspaceContext>
|
<AllWorkspaceContext>
|
||||||
<ModalProvider key={currentWorkspaceId} />
|
<CurrentWorkspaceContext>
|
||||||
</CurrentWorkspaceContext>
|
{/* fixme(himself65): don't re-render whole modals */}
|
||||||
</AllWorkspaceContext>
|
<ModalProvider key={currentWorkspaceId} />
|
||||||
|
</CurrentWorkspaceContext>
|
||||||
|
</AllWorkspaceContext>
|
||||||
|
</Suspense>
|
||||||
<CurrentWorkspaceContext>
|
<CurrentWorkspaceContext>
|
||||||
<Suspense fallback={<WorkspaceFallback />}>
|
<Suspense fallback={<WorkspaceFallback />}>
|
||||||
<Provider>
|
<Provider>
|
||||||
|
Loading…
Reference in New Issue
Block a user