checking if time is finite

closes #3416
This commit is contained in:
Miodec 2022-08-22 15:12:46 +02:00
parent 5b378cc606
commit 166ca6df6c
2 changed files with 2 additions and 2 deletions

View file

@ -101,7 +101,7 @@ export function hide(): void {
function apply(): void {
const val = parseInput($("#customTestDurationPopup input").val() as string);
if (val !== null && !isNaN(val) && val >= 0) {
if (val !== null && !isNaN(val) && val >= 0 && isFinite(val)) {
UpdateConfig.setTimeConfig(val as MonkeyTypes.TimeModes);
ManualRestart.set();
TestLogic.restart();

View file

@ -35,7 +35,7 @@ export function hide(): void {
function apply(): void {
const val = parseInt($("#customWordAmountPopup input").val() as string);
if (val !== null && !isNaN(val) && val >= 0) {
if (val !== null && !isNaN(val) && val >= 0 && isFinite(val)) {
UpdateConfig.setWordCount(val as MonkeyTypes.WordsModes);
ManualRestart.set();
TestLogic.restart();