diff --git a/packages/client/src/components/document/editor/index.tsx b/packages/client/src/components/document/editor/index.tsx index 93422b56..45093997 100644 --- a/packages/client/src/components/document/editor/index.tsx +++ b/packages/client/src/components/document/editor/index.tsx @@ -1,5 +1,5 @@ -import { IconArticle, IconChevronLeft } from '@douyinfe/semi-icons'; -import { Button, Nav, Popover, Skeleton, Space, Spin, Tooltip, Typography } from '@douyinfe/semi-ui'; +import { IconChevronLeft } from '@douyinfe/semi-icons'; +import { Button, Nav, Skeleton, Space, Spin, Tooltip, Typography } from '@douyinfe/semi-ui'; import { DataRender } from 'components/data-render'; import { Divider } from 'components/divider'; import { DocumentCollaboration } from 'components/document/collaboration'; @@ -50,16 +50,20 @@ export const DocumentEditor: React.FC = ({ documentId }) => { }); }, [document, documentId]); - const actions = ( - - {document && authority.readable && ( - - )} - - - - - + const actions = useMemo( + () => + docAuthLoading ? null : ( + + {document && authority.readable && ( + + )} + + + + + + ), + [docAuthLoading, documentId, document, authority] ); useEffect(() => { diff --git a/packages/client/src/components/document/reader/index.tsx b/packages/client/src/components/document/reader/index.tsx index 797b40b4..4a023422 100644 --- a/packages/client/src/components/document/reader/index.tsx +++ b/packages/client/src/components/document/reader/index.tsx @@ -76,27 +76,28 @@ export const DocumentReader: React.FC = ({ documentId }) => { }, [document]); const actions = useMemo( - () => ( - - {document && authority.readable && ( - - )} - {authority && authority.editable && ( - -