fix(core): workpace list blink issue on open (#5400)

This commit is contained in:
Peng Xiao 2023-12-26 07:37:41 +00:00
parent 3024b5cc63
commit c59a6a833c
No known key found for this signature in database
GPG Key ID: 23F23D9E8B3971ED

View File

@ -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,