mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-13 06:57:09 +03:00
Actually remove rejected promises from the pendingList
otherwise this may cause a failure to be "cached" and never removed, resulting in the inability to refresh segments until the page is refreshed
This commit is contained in:
@@ -37,8 +37,12 @@ export async function getSegmentsForVideo(videoID: VideoID, ignoreCache: boolean
|
|||||||
const pendingData = fetchSegmentsForVideo(videoID);
|
const pendingData = fetchSegmentsForVideo(videoID);
|
||||||
pendingList[videoID] = pendingData;
|
pendingList[videoID] = pendingData;
|
||||||
|
|
||||||
const result = await pendingData;
|
let result: Awaited<typeof pendingData>;
|
||||||
delete pendingList[videoID];
|
try {
|
||||||
|
result = await pendingData;
|
||||||
|
} finally {
|
||||||
|
delete pendingList[videoID];
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user