Handle invalid current minDuration in options.js

This commit is contained in:
Lartza 2020-01-24 02:29:11 +02:00
parent e6ef27936e
commit 34a21c6d8c

View file

@ -75,13 +75,16 @@ async function init() {
let configValue = SB.config[numberChangeOption];
let numberInput = optionsElements[i].querySelector("input");
if (configValue != undefined) {
if (isNaN(configValue) || configValue < 0) {
numberInput.value = 0;
} else {
numberInput.value = configValue;
}
numberInput.addEventListener("input", () => {
SB.config[numberChangeOption] = numberInput.value;
});
break;
}
}