From b6d9bea33a3ef017f3b6c12fce9735e2f49c3874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20K=C3=BChn?= Date: Wed, 22 Sep 2021 12:16:09 +0000 Subject: [PATCH] [FIX] mail: fix typos (likely to fix webRTC recovery every 30sec in case of failure) X-original-commit: 60eccab558d7a40cb4a27c7042f62f547e581ee6 Part-of: odoo/odoo#77107 --- addons/mail/static/src/models/rtc/rtc.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/mail/static/src/models/rtc/rtc.js b/addons/mail/static/src/models/rtc/rtc.js index 828175769e0..449660cc852 100644 --- a/addons/mail/static/src/models/rtc/rtc.js +++ b/addons/mail/static/src/models/rtc/rtc.js @@ -76,8 +76,8 @@ function factory(dependencies) { * This is distinct from this._recoverConnection which tries to restores * connection that were established but failed or timed out. */ - browser.setInterval(() => { - this.channel_id && this.currentRtcSession && this._callSessions(); + this._intervalId = browser.setInterval(() => { + this.channel && this.currentRtcSession && this._callSessions(); }, 30000); // 30 seconds } @@ -88,6 +88,7 @@ function factory(dependencies) { browser.removeEventListener('beforeunload', this._onBeforeUnload); browser.removeEventListener('keydown', this._onKeyDown); browser.removeEventListener('keyup', this._onKeyUp); + browser.clearInterval(this._intervalId); return super._willDelete(...arguments); }