aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/content.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/content.ts b/src/content.ts
index a30bf3a5..c02db6c6 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -1133,7 +1133,7 @@ function setupCategoryPill() {
}
async function sponsorsLookup(keepOldSubmissions = true, ignoreCache = false) {
- const videoID = getVideoID()
+ const videoID = getVideoID();
if (!videoID) {
console.error("[SponsorBlock] Attempted to fetch segments with a null/undefined videoID.");
return;
@@ -1141,6 +1141,9 @@ async function sponsorsLookup(keepOldSubmissions = true, ignoreCache = false) {
const segmentData = await getSegmentsForVideo(videoID, ignoreCache);
+ // Make sure an old pending request doesn't get used.
+ if (videoID !== getVideoID()) return;
+
// store last response status
lastResponseStatus = segmentData.status;
if (segmentData.status === 200) {