Fix unnecesary failure condition for chapter bar creation

This commit is contained in:
Ajay
2022-09-18 16:41:01 -04:00
parent 0b5c692c65
commit 2369fcc92d

View File

@@ -322,8 +322,7 @@ class PreviewBar {
if (segments.every((segments) => segments.source === SponsorSourceType.YouTube)
|| (!Config.config.renderSegmentsAsChapters
&& segments.every((segment) => segment.actionType !== ActionType.Chapter
|| segment.source === SponsorSourceType.YouTube))
|| this.chapterGroups?.length <= 0) {
|| segment.source === SponsorSourceType.YouTube))) {
if (this.customChaptersBar) this.customChaptersBar.style.display = "none";
this.originalChapterBar.style.removeProperty("display");
return;
@@ -349,6 +348,12 @@ class PreviewBar {
this.chapterGroups = this.unfilteredChapterGroups;
}
if (!this.chapterGroups || this.chapterGroups.length <= 0) {
if (this.customChaptersBar) this.customChaptersBar.style.display = "none";
this.originalChapterBar.style.removeProperty("display");
return;
}
// Create it from cloning
let createFromScratch = false;
if (!this.customChaptersBar || !this.progressBar.contains(this.customChaptersBar)) {