From 4c03a56dabf1aea066c2eb4230d564cbe1d089af Mon Sep 17 00:00:00 2001 From: Nicolas Bayet Date: Wed, 8 Sep 2021 09:09:10 +0000 Subject: [PATCH] [FIX] web_editor: stop making snapshot when no collaboration When the collaboration is not active, it is not necessary to create snapshot as they will not be sent to anybody. Part-of: odoo/odoo#76143 --- .../web_editor/static/lib/odoo-editor/src/OdooEditor.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/web_editor/static/lib/odoo-editor/src/OdooEditor.js b/addons/web_editor/static/lib/odoo-editor/src/OdooEditor.js index ead7f5b5713..bb0180e2817 100644 --- a/addons/web_editor/static/lib/odoo-editor/src/OdooEditor.js +++ b/addons/web_editor/static/lib/odoo-editor/src/OdooEditor.js @@ -267,9 +267,11 @@ export class OdooEditor extends EventTarget { this._resizeObserver.observe(this.editable); this.addDomListener(this.editable, 'scroll', this.multiselectionRefresh); - this._snapshotInterval = setInterval(() => { - this._historyMakeSnapshot(); - }, HISTORY_SNAPSHOT_INTERVAL); + if (this._collabClientId) { + this._snapshotInterval = setInterval(() => { + this._historyMakeSnapshot(); + }, HISTORY_SNAPSHOT_INTERVAL); + } // ------- // Toolbar