1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-14 04:35:57 +01:00

Fix handling of empty strings in reflectSettings.

This commit is contained in:
Juliusz Chroboczek 2020-11-30 21:53:25 +01:00
parent 8df19bc760
commit 9110d03a9a

View file

@ -183,29 +183,31 @@ function reflectSettings() {
setLocalMute(settings.localMute); setLocalMute(settings.localMute);
let videoselect = getSelectElement('videoselect'); let videoselect = getSelectElement('videoselect');
if(!settings.video || !selectOptionAvailable(videoselect, settings.video)) { if(!settings.hasOwnProperty('video') ||
!selectOptionAvailable(videoselect, settings.video)) {
settings.video = selectOptionDefault(videoselect); settings.video = selectOptionDefault(videoselect);
store = true; store = true;
} }
videoselect.value = settings.video; videoselect.value = settings.video;
let audioselect = getSelectElement('audioselect'); let audioselect = getSelectElement('audioselect');
if(!settings.audio || !selectOptionAvailable(audioselect, settings.audio)) { if(!settings.hasOwnProperty('audio') ||
!selectOptionAvailable(audioselect, settings.audio)) {
settings.audio = selectOptionDefault(audioselect); settings.audio = selectOptionDefault(audioselect);
store = true; store = true;
} }
audioselect.value = settings.audio; audioselect.value = settings.audio;
if(settings.request) if(settings.hasOwnProperty('request')) {
getSelectElement('requestselect').value = settings.request; getSelectElement('requestselect').value = settings.request;
else { } else {
settings.request = getSelectElement('requestselect').value; settings.request = getSelectElement('requestselect').value;
store = true; store = true;
} }
if(settings.send) if(settings.hasOwnProperty('send')) {
getSelectElement('sendselect').value = settings.send; getSelectElement('sendselect').value = settings.send;
else { } else {
settings.send = getSelectElement('sendselect').value; settings.send = getSelectElement('sendselect').value;
store = true; store = true;
} }
@ -216,7 +218,6 @@ function reflectSettings() {
if(store) if(store)
storeSettings(settings); storeSettings(settings);
} }
function showVideo() { function showVideo() {