diff --git a/app/ui.js b/app/ui.js index d3f004fb..da9f67d9 100644 --- a/app/ui.js +++ b/app/ui.js @@ -1165,13 +1165,17 @@ const UI = { getSetting(name) { const ctrl = document.getElementById('noVNC_setting_' + name); let val = WebUtil.readSetting(name); - if (typeof val !== 'undefined' && val !== null && ctrl.type === 'checkbox') { - if (val.toString().toLowerCase() in {'0': 1, 'no': 1, 'false': 1}) { + + if (val != null && ctrl.type === 'checkbox') { + const str = String(val).toLowerCase(); + const falseStrings = [ '0', 'no', 'false']; + if (falseStrings.includes(str)) { val = false; } else { val = true; } } + return val; }, @@ -3051,4 +3055,4 @@ if (l10n.language === "en" || l10n.dictionary !== undefined) { .then(UI.prime); } -export default UI; \ No newline at end of file +export default UI;