[FIX] mail: prevent incorrect loading of settings from the localstorage

Before this commit, the settings recovered from the localStorage were
incorrectly loaded to the model fields.

This commit fixes this issue.

taskId-2823292

closes odoo/odoo#88828

X-original-commit: 5b429e54b732257075e0925211e9ab9b0b827ca1
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
Thanh Dodeur
2022-04-19 16:40:06 +02:00
committed by Alexandre Kühn
parent 2745baaf04
commit 841373e2c4
@@ -179,13 +179,10 @@ registerModel({
const audioInputDeviceId = this.env.services.local_storage.getItem(
"mail_user_setting_audio_input_device_id"
);
const voiceActivationThreshold = parseFloat(voiceActivationThresholdString);
if (voiceActivationThreshold > 0) {
this.update({
voiceActivationThreshold,
audioInputDeviceId,
});
}
this.update({
voiceActivationThreshold: voiceActivationThresholdString ? parseFloat(voiceActivationThresholdString) : undefined,
audioInputDeviceId: audioInputDeviceId || undefined,
});
},
/**
* @private