[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
This commit is contained in:
Nicolas Bayet
2021-09-08 10:22:06 +00:00
parent d23ec015c1
commit 4c03a56dab
@@ -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