fixed: handle bool and int params
This commit is contained in:
parent
aa19c9d890
commit
dc5053edf3
17
main.js
17
main.js
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue