diff --git a/src/components/editor-page/editor-pane/hooks/yjs/websocket-connection.ts b/src/components/editor-page/editor-pane/hooks/yjs/websocket-connection.ts index 085fa6136..ef412140e 100644 --- a/src/components/editor-page/editor-pane/hooks/yjs/websocket-connection.ts +++ b/src/components/editor-page/editor-pane/hooks/yjs/websocket-connection.ts @@ -51,7 +51,7 @@ export class WebsocketConnection extends WebsocketTransporter { private bindYDocEvents(doc: Doc): void { doc.on('destroy', () => this.disconnect()) doc.on('update', (update: Uint8Array, origin: unknown) => { - if (origin !== this && this.isSynced()) { + if (origin !== this && this.isSynced() && this.isWebSocketOpen()) { this.send(encodeDocumentUpdateMessage(update)) } })