Added Random Hour function, minor refactoring

This commit is contained in:
Danilo Titato
2023-03-01 20:57:26 -03:00
parent 5a89ede16b
commit 0d3cc2afc4
6 changed files with 194 additions and 429 deletions
+4 -3
View File
@@ -230,18 +230,19 @@ var addedTimeCounter;
var timeoutID;
const addTime = async (time, s) => {
let addedTime = Math.floor(s);
if(!bulk_enabled) {
endingTimeBeforeCounter = time;
addedTimeCounter = s;
addedTimeCounter = addedTime;
addTimeInternal();
return;
}
if(firstSub) {
firstSub = false;
endingTimeBeforeCounter = time;
addedTimeCounter = s;
addedTimeCounter = addedTime;
} else {
addedTimeCounter += s;
addedTimeCounter += addedTime;
window.clearTimeout(timeoutID);
}
timeoutID = window.setTimeout(addTimeInternal, 1000);