fix: change setting with type

This commit is contained in:
quenousimporte 2023-09-24 15:19:39 +02:00
parent dc5053edf3
commit 8930b7cbbd
1 changed files with 8 additions and 10 deletions

18
main.js
View File

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