Skip to content

Commit 9d48d4e

Browse files
committed
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
1 parent 06ead87 commit 9d48d4e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/utils/segmentData.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,12 @@ export async function getSegmentsForVideo(videoID: VideoID, ignoreCache: boolean
3737
const pendingData = fetchSegmentsForVideo(videoID);
3838
pendingList[videoID] = pendingData;
3939

40-
const result = await pendingData;
41-
delete pendingList[videoID];
40+
let result: Awaited<typeof pendingData>;
41+
try {
42+
result = await pendingData;
43+
} finally {
44+
delete pendingList[videoID];
45+
}
4246

4347
return result;
4448
}

0 commit comments

Comments
 (0)