From 21f6f396d4784a48ceebfd51dd55165d34e5466d Mon Sep 17 00:00:00 2001 From: Jonas Date: Tue, 11 Jul 2023 13:27:27 +0200 Subject: [PATCH] fix(sync): Set `disableBc: true` in debug mode Signed-off-by: Jonas --- src/services/SyncServiceProvider.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/services/SyncServiceProvider.js b/src/services/SyncServiceProvider.js index 757823640c9..cb4b6f1648c 100644 --- a/src/services/SyncServiceProvider.js +++ b/src/services/SyncServiceProvider.js @@ -38,11 +38,12 @@ export default function createSyncServiceProvider({ ydoc, syncService, fileId, i throw new Error('fileId is required') } const WebSocketPolyfill = initWebSocketPolyfill(syncService, fileId, initialSession) + const disableBc = !!window?._oc_debug const websocketProvider = new WebsocketProvider( 'ws://localhost:1234', 'file:' + fileId, ydoc, - { WebSocketPolyfill, disableBc: true }, + { WebSocketPolyfill, disableBc }, ) websocketProvider.on('status', event => logger.debug('status', event)) return websocketProvider