mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-11 22:17:21 +03:00
Fix potentially leaking set interval
This commit is contained in:
@@ -684,6 +684,7 @@ async function startSponsorSchedule(includeIntersectingSegments = false, current
|
|||||||
const reportedVideoTimeAtStart = getVideo().currentTime;
|
const reportedVideoTimeAtStart = getVideo().currentTime;
|
||||||
logDebug(`Starting setInterval skipping ${getVideo().currentTime} to skip at ${skipTime[0]}`);
|
logDebug(`Starting setInterval skipping ${getVideo().currentTime} to skip at ${skipTime[0]}`);
|
||||||
|
|
||||||
|
if (currentSkipInterval !== null) clearInterval(currentSkipInterval);
|
||||||
currentSkipInterval = setInterval(() => {
|
currentSkipInterval = setInterval(() => {
|
||||||
// Estimate delay, but only take the current time right after a change
|
// Estimate delay, but only take the current time right after a change
|
||||||
// Current time remains the same for many "frames" on Firefox
|
// Current time remains the same for many "frames" on Firefox
|
||||||
|
|||||||
Reference in New Issue
Block a user