fixed: handle bool and int params

This commit is contained in:
quenousimporte 2023-09-23 23:09:09 +02:00
parent aa19c9d890
commit dc5053edf3
1 changed files with 15 additions and 2 deletions

17
main.js
View File

@ -946,9 +946,22 @@ function changesetting()
.then(setting => .then(setting =>
{ {
var name = setting.split(":").shift(); var name = setting.split(":").shift();
if (settings[name]) if (typeof settings[name] != "undefined")
{ {
settings[name] = prompt(name, settings[name]); var value = prompt(name, settings[name]);
if (!isNaN(parseInt(value)))
{
value = parseInt(value)
}
else if (value === "false")
{
value = false;
}
else if (value == "true")
{
value = true;
}
settings[name] = value;
savesettings(); savesettings();
loadsettings(); loadsettings();
} }