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