fix(playback): support current web build target

This commit is contained in:
4gray committed 2026-08-09 12:52:05 +02:00
1 parent 9e6c67ff48
commit 13b1cfe57e
1 file changed
+12 -4
@@ -102,10 +102,7 @@ function revealCappedExternalSiblings(
continue;
}
if (retained.length >= 3) {
const replaceIndex = retained.findLastIndex(
(recommendation, index) =>
index > 0 && !isExternalRecommendation(recommendation)
);
const replaceIndex = findLastReplaceableRecommendation(retained);
if (replaceIndex < 0) {
continue;
}
@@ -116,6 +113,17 @@ function revealCappedExternalSiblings(
return retained;
}
function findLastReplaceableRecommendation(
recommendations: readonly PlaybackRecommendation[]
): number {
for (let index = recommendations.length - 1; index > 0; index -= 1) {
if (!isExternalRecommendation(recommendations[index])) {
return index;
}
}
return -1;
}
function rerankExternalRecommendations(
recommendations: readonly PlaybackRecommendation[],
states: ExternalRecoveryStates