mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-13 23:17:05 +03:00
Make sure old segment fetch request doesn't get used
May fix #2101
See dbf80b4929 (r147058589)
This commit is contained in:
@@ -1133,7 +1133,7 @@ function setupCategoryPill() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function sponsorsLookup(keepOldSubmissions = true, ignoreCache = false) {
|
async function sponsorsLookup(keepOldSubmissions = true, ignoreCache = false) {
|
||||||
const videoID = getVideoID()
|
const videoID = getVideoID();
|
||||||
if (!videoID) {
|
if (!videoID) {
|
||||||
console.error("[SponsorBlock] Attempted to fetch segments with a null/undefined videoID.");
|
console.error("[SponsorBlock] Attempted to fetch segments with a null/undefined videoID.");
|
||||||
return;
|
return;
|
||||||
@@ -1141,6 +1141,9 @@ async function sponsorsLookup(keepOldSubmissions = true, ignoreCache = false) {
|
|||||||
|
|
||||||
const segmentData = await getSegmentsForVideo(videoID, ignoreCache);
|
const segmentData = await getSegmentsForVideo(videoID, ignoreCache);
|
||||||
|
|
||||||
|
// Make sure an old pending request doesn't get used.
|
||||||
|
if (videoID !== getVideoID()) return;
|
||||||
|
|
||||||
// store last response status
|
// store last response status
|
||||||
lastResponseStatus = segmentData.status;
|
lastResponseStatus = segmentData.status;
|
||||||
if (segmentData.status === 200) {
|
if (segmentData.status === 200) {
|
||||||
|
|||||||
Reference in New Issue
Block a user