fix: change setting with type
This commit is contained in:
parent
dc5053edf3
commit
8930b7cbbd
18
main.js
18
main.js
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue