mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-16 17:46:18 +08:00
refactor: redesign loading workspace db
This commit is contained in:
@@ -641,7 +641,7 @@ export class BlockClient<
|
||||
const { importData, exportData, hasExporter, installExporter } =
|
||||
getDataExporter();
|
||||
|
||||
const instance = await YjsAdapter.init(workspace, {
|
||||
const yjsAdapter = await YjsAdapter.init(workspace, {
|
||||
provider: getYjsProviders({
|
||||
enabled: [],
|
||||
backend: BucketBackend.YjsWebSocketAffine,
|
||||
@@ -652,10 +652,17 @@ export class BlockClient<
|
||||
}),
|
||||
...options,
|
||||
});
|
||||
return new BlockClient(instance, workspace, {
|
||||
...options,
|
||||
installExporter,
|
||||
});
|
||||
|
||||
const blockClient: BlockClientInstance = new BlockClient(
|
||||
yjsAdapter,
|
||||
workspace,
|
||||
{
|
||||
...options,
|
||||
installExporter,
|
||||
}
|
||||
);
|
||||
await blockClient.buildIndex();
|
||||
return blockClient;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user