diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js index 9451b1b1674..81a68883400 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -468,6 +468,7 @@ const Wysiwyg = Widget.extend({ // Wether or not the history has been sent or received at least once. let historySyncAtLeastOnce = false; let historySyncFinished = false; + let historyStepsBuffer = []; return new PeerToPeer({ peerConnectionConfig: { iceServers: this._iceServers }, @@ -556,6 +557,11 @@ const Wysiwyg = Widget.extend({ this.odooEditor.onExternalMultiselectionUpdate(remoteSelection); } } + // In case there are steps received in the meantime, process them. + if (historyStepsBuffer.length) { + this.odooEditor.onExternalHistorySteps(historyStepsBuffer); + historyStepsBuffer = []; + } historySyncFinished = true; } else { const remoteSelection = await this.ptp.requestClient(fromClientId, 'get_collaborative_selection', undefined, { transport: 'rtc' }); @@ -570,6 +576,8 @@ const Wysiwyg = Widget.extend({ // before the history has synced at least once. if (historySyncFinished) { this.odooEditor.onExternalHistorySteps([notificationPayload]); + } else { + historyStepsBuffer.push(notificationPayload); } break; case 'oe_history_set_selection': {