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(core): workpace list blink issue on open (#5400)

Peng Xiaoc59a6a833c9d
diff --git a/packages/frontend/core/src/components/root-app-sidebar/index.tsx b/packages/frontend/core/src/components/root-app-sidebar/index.tsx
index 6162ec023a..151e3181cd 100644
--- a/packages/frontend/core/src/components/root-app-sidebar/index.tsx
+++ b/packages/frontend/core/src/components/root-app-sidebar/index.tsx
@@ -30,7 +30,7 @@ import { useAsyncCallback } from '@toeverything/hooks/affine-async-hooks';
import { useAtom, useAtomValue } from 'jotai';
import { nanoid } from 'nanoid';
import type { HTMLAttributes, ReactElement } from 'react';
-import { forwardRef, useCallback, useEffect, useMemo } from 'react';
+import { forwardRef, Suspense, useCallback, useEffect, useMemo } from 'react';
import { openWorkspaceListModalAtom } from '../../atoms';
import { useHistoryAtom } from '../../atoms/history';
@@ -218,7 +218,11 @@ export const RootAppSidebar = ({
rootOptions={{
open: openUserWorkspaceList,
}}
- items={<UserWithWorkspaceList onEventEnd={closeUserWorkspaceList} />}
+ items={
+ <Suspense>
+ <UserWithWorkspaceList onEventEnd={closeUserWorkspaceList} />
+ </Suspense>
+ }
contentOptions={{
// hide trigger
sideOffset: -58,