Fix issue with early highlight breaking skipping

This commit is contained in:
Ajay Ramachandran
2021-08-22 20:47:46 -04:00
parent a9e43f95f5
commit 15706fd3c4

View File

@@ -961,14 +961,14 @@ function getNextSkipIndex(currentTime: number, includeIntersectingSegments: bool
if ((minUnsubmittedSponsorTimeIndex === -1 && minSponsorTimeIndex !== -1) || if ((minUnsubmittedSponsorTimeIndex === -1 && minSponsorTimeIndex !== -1) ||
sponsorStartTimes[minSponsorTimeIndex] < unsubmittedSponsorStartTimes[minUnsubmittedSponsorTimeIndex]) { sponsorStartTimes[minSponsorTimeIndex] < unsubmittedSponsorStartTimes[minUnsubmittedSponsorTimeIndex]) {
return { return {
array: sponsorTimes, array: sponsorTimes.filter((segment) => getCategoryActionType(segment.category) === CategoryActionType.Skippable),
index: minSponsorTimeIndex, index: minSponsorTimeIndex,
endIndex: endTimeIndex, endIndex: endTimeIndex,
openNotice: true openNotice: true
}; };
} else { } else {
return { return {
array: sponsorTimesSubmitting, array: sponsorTimesSubmitting.filter((segment) => getCategoryActionType(segment.category) === CategoryActionType.Skippable),
index: minUnsubmittedSponsorTimeIndex, index: minUnsubmittedSponsorTimeIndex,
endIndex: previewEndTimeIndex, endIndex: previewEndTimeIndex,
openNotice: false openNotice: false