mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
fix: infinite loading on public workspace (#1074)
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { ReactElement, useEffect, useMemo, useState } from 'react';
|
import { ReactElement, useEffect, useMemo } from 'react';
|
||||||
import type { NextPageWithLayout } from '../..//_app';
|
import type { NextPageWithLayout } from '../..//_app';
|
||||||
import { displayFlex, styled } from '@affine/component';
|
import { displayFlex, styled } from '@affine/component';
|
||||||
import dynamic from 'next/dynamic';
|
import dynamic from 'next/dynamic';
|
||||||
@@ -22,7 +22,6 @@ const Page: NextPageWithLayout = () => {
|
|||||||
const { workspaceId, pageId } = router.query as Record<string, string>;
|
const { workspaceId, pageId } = router.query as Record<string, string>;
|
||||||
const { status, workspace: workspaceUnit } =
|
const { status, workspace: workspaceUnit } =
|
||||||
useLoadPublicWorkspace(workspaceId);
|
useLoadPublicWorkspace(workspaceId);
|
||||||
const [editorLoaded, setEditorLoaded] = useState(false);
|
|
||||||
const { triggerQuickSearchModal } = useModal();
|
const { triggerQuickSearchModal } = useModal();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
@@ -50,7 +49,7 @@ const Page: NextPageWithLayout = () => {
|
|||||||
}
|
}
|
||||||
}, [router, status]);
|
}, [router, status]);
|
||||||
|
|
||||||
if (status === 'loading' || !editorLoaded) {
|
if (status === 'loading') {
|
||||||
return <PageLoading />;
|
return <PageLoading />;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,7 +90,6 @@ const Page: NextPageWithLayout = () => {
|
|||||||
workspace={workspace}
|
workspace={workspace}
|
||||||
setEditor={editor => {
|
setEditor={editor => {
|
||||||
editor.readonly = true;
|
editor.readonly = true;
|
||||||
setEditorLoaded(true);
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user