VNC-232 refactored getSetting (#152)
Co-authored-by: matt <matt@kasmsweb.com>
This commit is contained in:
parent
6212a9c806
commit
df061dc3d5
10
app/ui.js
10
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;
|
||||
export default UI;
|
||||
|
|
|
|||
Loading…
Reference in New Issue