refactor(editor): remove assertExists (#10615)

This commit is contained in:
Saul-Mirone
2025-03-05 00:13:08 +00:00
parent a6692f70aa
commit b8ecfbdae6
106 changed files with 863 additions and 517 deletions

View File

@@ -1,4 +1,3 @@
import { assertExists } from '@blocksuite/global/utils';
import { diffUpdate, encodeStateVectorFromUpdate, mergeUpdates } from 'yjs';
import { MANUALLY_STOP } from '../../utils/throw-if-aborted.js';
@@ -66,7 +65,12 @@ export class BroadcastChannelDocSource implements DocSource {
this.docMap.set(docId, data);
}
assertExists(this.docMap.get(docId));
const doc = this.docMap.get(docId);
if (!doc) {
console.error('data is not found when syncing broadcast channel');
return;
}
this.channel.postMessage({
type: 'update',
docId,