fix: buffer length 0 issue

This commit is contained in:
alt0
2022-12-22 15:36:12 +08:00
parent 730084f869
commit dab8bd8eb4
@@ -91,10 +91,13 @@ const DynamicBlocksuite = ({
if (indexDBProvider) {
(indexDBProvider as IndexedDBDocProvider)?.on('synced', async () => {
const updates = await downloadWorkspace({ workspaceId });
updates &&
if (updates.byteLength) {
Workspace.Y.applyUpdate(workspace.doc, new Uint8Array(updates));
// if after update, the space:meta is empty, then we need to get map with doc
workspace.doc.getMap('space:meta');
// if after update, the space:meta is empty, then we need to get map with doc
workspace.doc.getMap('space:meta');
}
resolve(workspace);
});
} else {