Fix potentially leaking set interval

This commit is contained in:
Ajay
2023-03-24 15:51:36 -04:00
parent c1a61b9795
commit 6d7953a1ca

View File

@@ -684,6 +684,7 @@ async function startSponsorSchedule(includeIntersectingSegments = false, current
const reportedVideoTimeAtStart = getVideo().currentTime;
logDebug(`Starting setInterval skipping ${getVideo().currentTime} to skip at ${skipTime[0]}`);
if (currentSkipInterval !== null) clearInterval(currentSkipInterval);
currentSkipInterval = setInterval(() => {
// Estimate delay, but only take the current time right after a change
// Current time remains the same for many "frames" on Firefox