Fix saving config

This commit is contained in:
crobibero
2021-02-24 12:57:33 -07:00
parent b32e2f4d84
commit aa98344809
@@ -111,6 +111,7 @@
for (const key in uconfig) { for (const key in uconfig) {
const element = document.querySelector("#configOptionsContainer #" + key); const element = document.querySelector("#configOptionsContainer #" + key);
if (element) {
if (element.type === 'checkbox') { if (element.type === 'checkbox') {
uconfig[key] = element.checked; uconfig[key] = element.checked;
} else { } else {
@@ -119,6 +120,7 @@
} }
} }
} }
}
console.log("Saving config:"); console.log("Saving config:");
console.log(this.configCache); console.log(this.configCache);
@@ -128,7 +130,6 @@
SimklConfig.simklName.innerText = (await SimklAPI.getUserSettings(userConfig.Id)).user.name; SimklConfig.simklName.innerText = (await SimklAPI.getUserSettings(userConfig.Id)).user.name;
for (const key in userConfig) { for (const key in userConfig) {
console.log(key, userConfig[key]);
const chk = document.querySelector("#configOptionsContainer input[type=checkbox]#" + key); const chk = document.querySelector("#configOptionsContainer input[type=checkbox]#" + key);
if (chk) { if (chk) {
chk.checked = userConfig[key]; chk.checked = userConfig[key];
@@ -144,7 +145,6 @@
this.onLoginProcess = true; this.onLoginProcess = true;
const code = await SimklAPI.getCode(); const code = await SimklAPI.getCode();
console.log(code);
this.finish = new Date(); this.finish = new Date();
this.finish.setSeconds(this.finish.getSeconds() + code.expires_in); this.finish.setSeconds(this.finish.getSeconds() + code.expires_in);
this.nextInterval = new Date(); this.nextInterval = new Date();
@@ -246,7 +246,7 @@
return result; return result;
}) })
.catch(function (result) { .catch(function (result) {
console.log(result); console.error(result);
Dashboard.alert("Some error occurred, see browser log for more details"); Dashboard.alert("Some error occurred, see browser log for more details");
SimklConfig.stopLoginProcess(); SimklConfig.stopLoginProcess();
}); });
@@ -265,7 +265,7 @@
return result; return result;
}) })
.catch(function (result) { .catch(function (result) {
console.log(result); console.error(result);
Dashboard.alert("Some error occurred, see browser log for more details"); Dashboard.alert("Some error occurred, see browser log for more details");
SimklConfig.stopLoginProcess(); SimklConfig.stopLoginProcess();
}); });
@@ -284,7 +284,7 @@
return result; return result;
}) })
.catch(function (result) { .catch(function (result) {
console.log(result); console.error(result);
Dashboard.alert("Something went wrong, see logs for more details"); Dashboard.alert("Something went wrong, see logs for more details");
}); });
} }