mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-20 19:46:32 +08:00
perf: use lazy load provider for IDB and SQLITE (#3351)
This commit is contained in:
@@ -45,7 +45,7 @@ const ImagePreviewModal = lazy(() =>
|
||||
);
|
||||
|
||||
const BlockSuiteEditorImpl = (props: EditorProps): ReactElement => {
|
||||
const { onLoad, page, mode, style, onInit } = props;
|
||||
const { onLoad, page, mode, style } = props;
|
||||
if (!page.loaded) {
|
||||
use(page.waitForLoaded());
|
||||
}
|
||||
@@ -66,14 +66,9 @@ const BlockSuiteEditorImpl = (props: EditorProps): ReactElement => {
|
||||
editor.mode = mode;
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (editor.page !== page) {
|
||||
editor.page = page;
|
||||
if (page.root === null) {
|
||||
onInit(page, editor);
|
||||
}
|
||||
}
|
||||
}, [editor, page, onInit]);
|
||||
if (editor.page !== page) {
|
||||
editor.page = page;
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (editor.page && onLoad) {
|
||||
|
||||
Reference in New Issue
Block a user