fix(core): disable sync doc/blob on start (#4897)

This commit is contained in:
Peng Xiao
2023-11-10 02:00:53 +08:00
committed by GitHub
parent 9d89e4f7f5
commit fd74776abe
2 changed files with 2 additions and 5 deletions

View File

@@ -10,7 +10,6 @@ import {
WorkspaceFlavour,
} from '@affine/env/workspace';
import { CRUD as CloudCRUD } from '@affine/workspace/affine/crud';
import { startSync, stopSync } from '@affine/workspace/affine/sync';
import { UI as CloudUI } from './cloud/ui';
import { LocalAdapter } from './local';
@@ -41,8 +40,6 @@ export const WorkspaceAdapters = {
return false;
}
},
'service:start': startSync,
'service:stop': stopSync,
} as Partial<AppEvents>,
CRUD: CloudCRUD,
UI: CloudUI,

View File

@@ -82,10 +82,10 @@ export function loadPage(page: Page, priority = 0) {
if (!page.loaded) {
await awaitForIdle();
await page.waitForLoaded();
logger.debug('page loaded', page.id);
// we do not know how long it takes to load a page here
// so that we just use 300ms timeout as the default page processing time
await awaitForTimeout(300);
logger.debug('page loaded', page.id);
await awaitForTimeout(1000);
} else {
// do nothing if it is already loaded
}