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 =>
{
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]);
if (!isNaN(parseInt(value)))
value = prompt(name, value);
if (type == "number")
{
value = parseInt(value)
value = parseInt(value);
}
else if (value === "false")
else if (type == "boolean")
{
value = false;
}
else if (value == "true")
{
value = true;
value = value === "true";
}
settings[name] = value;
savesettings();