From 958cf7d60292de66b66910ee8931498561dcd55b Mon Sep 17 00:00:00 2001 From: tsm-odoo Date: Thu, 28 Apr 2022 16:26:33 +0000 Subject: [PATCH] [IMP] mail: replace local_storage service by the browser one MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR prepares the ground for the introduction of the wowlEnv in the discuss app. Indeed, the local_storage service is not available as a service anymore so the one from the browser is used instead. In order to reduce the noise in the main PR, this change is done separately. task-2582313 closes odoo/odoo#89851 Signed-off-by: Sébastien Theys (seb) --- addons/mail/static/src/models/user_setting.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/mail/static/src/models/user_setting.js b/addons/mail/static/src/models/user_setting.js index d95f30075ae..58489aeca02 100644 --- a/addons/mail/static/src/models/user_setting.js +++ b/addons/mail/static/src/models/user_setting.js @@ -102,7 +102,7 @@ registerModel({ this.update({ audioInputDeviceId, }); - this.env.services.local_storage.setItem('mail_user_setting_audio_input_device_id', audioInputDeviceId); + browser.localStorage.setItem('mail_user_setting_audio_input_device_id', audioInputDeviceId); await this.messaging.rtc.updateLocalAudioTrack(true); }, /** @@ -150,7 +150,7 @@ registerModel({ */ async setThresholdValue(voiceActivationThreshold) { this.update({ voiceActivationThreshold }); - this.env.services.local_storage.setItem('mail_user_setting_voice_threshold', voiceActivationThreshold); + browser.localStorage.setItem('mail_user_setting_voice_threshold', voiceActivationThreshold.toString()); await this.messaging.rtc.updateVoiceActivation(); }, async togglePushToTalk() { @@ -173,10 +173,10 @@ registerModel({ * @private */ _loadLocalSettings() { - const voiceActivationThresholdString = this.env.services.local_storage.getItem( + const voiceActivationThresholdString = browser.localStorage.getItem( "mail_user_setting_voice_threshold" ); - const audioInputDeviceId = this.env.services.local_storage.getItem( + const audioInputDeviceId = browser.localStorage.getItem( "mail_user_setting_audio_input_device_id" ); this.update({