mirror of
https://github.com/element-hq/element-web
synced 2024-11-23 17:56:01 +03:00
Don't setValue() if that would lead to setting a null/undefined
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
bc336abf47
commit
9533f7b0b9
1 changed files with 4 additions and 2 deletions
|
@ -118,8 +118,10 @@ export default class AccountSettingsHandler extends MatrixClientBackedSettingsHa
|
|||
if (value === null || value === undefined) {
|
||||
const oldCombinedValue = settings["autoplayGifsAndVideos"];
|
||||
// Write, so that we can remove this in the future
|
||||
this.setValue("autoplayGifs", roomId, oldCombinedValue);
|
||||
this.setValue("autoplayVideo", roomId, oldCombinedValue);
|
||||
if (oldCombinedValue !== null && oldCombinedValue !== undefined) {
|
||||
this.setValue("autoplayGifs", roomId, oldCombinedValue);
|
||||
this.setValue("autoplayVideo", roomId, oldCombinedValue);
|
||||
}
|
||||
return oldCombinedValue;
|
||||
}
|
||||
return value;
|
||||
|
|
Loading…
Reference in a new issue