1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 09:49:28 +02:00

Avoid multiple call on the same selector

This commit is contained in:
DanielnetoDotCom 2021-03-18 23:17:18 -03:00
parent 664bf03b09
commit 7b80eb3001

View file

@ -1263,10 +1263,11 @@ function validURL(str) {
function isURL(url) {
return validURL(url);
}
var startTimerInterval = [];
function startTimer(duration, selector) {
clearInterval(startTimerInterval[selector]);
var timer = duration;
var startTimerInterval = setInterval(function () {
startTimerInterval[selector] = setInterval(function () {
// Time calculations for days, hours, minutes and seconds
var years = Math.floor(duration / (60 * 60 * 24 * 365));