mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-30 00:29:46 +08:00
fix(core): fix no page root error (#9190)
This commit is contained in:
+6
-4
@@ -129,15 +129,17 @@ export const BlockSuiteEditor = (props: EditorProps) => {
|
|||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const disposable = props.page.slots.rootAdded.once(() => {
|
const timer = setTimeout(() => {
|
||||||
setIsLoading(false);
|
|
||||||
});
|
|
||||||
window.setTimeout(() => {
|
|
||||||
disposable.dispose();
|
disposable.dispose();
|
||||||
setError(new NoPageRootError(props.page));
|
setError(new NoPageRootError(props.page));
|
||||||
}, 20 * 1000);
|
}, 20 * 1000);
|
||||||
|
const disposable = props.page.slots.rootAdded.once(() => {
|
||||||
|
setIsLoading(false);
|
||||||
|
clearTimeout(timer);
|
||||||
|
});
|
||||||
return () => {
|
return () => {
|
||||||
disposable.dispose();
|
disposable.dispose();
|
||||||
|
clearTimeout(timer);
|
||||||
};
|
};
|
||||||
}, [props.page]);
|
}, [props.page]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user