Default to chapters tab if no normal segments

This commit is contained in:
Ajay
2022-09-23 01:24:27 -04:00
parent ca931f18f6
commit 6d1a29019b

View File

@@ -504,9 +504,15 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
if (!sponsorTimes.some((segment) => segment.actionType === ActionType.Chapter && segment.source !== SponsorSourceType.YouTube)) {
PageElements.issueReporterTabs.classList.add("hidden");
currentSegmentTab = SegmentTab.Segments;
} else {
if (currentSegmentTab === SegmentTab.Segments
&& sponsorTimes.every((segment) => segment.actionType === ActionType.Chapter)) {
PageElements.issueReporterTabs.classList.add("hidden");
currentSegmentTab = SegmentTab.Chapters;
} else {
PageElements.issueReporterTabs.classList.remove("hidden");
}
}
// Sort list by start time
const downloadedTimes = sponsorTimes