report type setting handler (commited in wrong branch)

This commit is contained in:
quenousimporte 2023-09-25 14:14:41 +02:00
parent a3c8d25299
commit 9bb5aa8287
1 changed files with 17 additions and 3 deletions

20
main.js
View File

@ -943,9 +943,23 @@ function editsetting(name)
{ {
if (settings[name]) if (settings[name])
{ {
settings[name] = prompt(name, settings[name]); var value = settings[name];
savesettings(); var type = typeof value;
loadsettings(); if (type != "undefined")
{
value = prompt(name, value);
if (type == "number")
{
value = parseInt(value);
}
else if (type == "boolean")
{
value = value === "true";
}
settings[name] = value;;
savesettings();
loadsettings();
}
} }
} }