mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-07 12:07:11 +03:00
Fix unnecesary failure condition for chapter bar creation
This commit is contained in:
@@ -322,8 +322,7 @@ class PreviewBar {
|
|||||||
if (segments.every((segments) => segments.source === SponsorSourceType.YouTube)
|
if (segments.every((segments) => segments.source === SponsorSourceType.YouTube)
|
||||||
|| (!Config.config.renderSegmentsAsChapters
|
|| (!Config.config.renderSegmentsAsChapters
|
||||||
&& segments.every((segment) => segment.actionType !== ActionType.Chapter
|
&& segments.every((segment) => segment.actionType !== ActionType.Chapter
|
||||||
|| segment.source === SponsorSourceType.YouTube))
|
|| segment.source === SponsorSourceType.YouTube))) {
|
||||||
|| this.chapterGroups?.length <= 0) {
|
|
||||||
if (this.customChaptersBar) this.customChaptersBar.style.display = "none";
|
if (this.customChaptersBar) this.customChaptersBar.style.display = "none";
|
||||||
this.originalChapterBar.style.removeProperty("display");
|
this.originalChapterBar.style.removeProperty("display");
|
||||||
return;
|
return;
|
||||||
@@ -349,6 +348,12 @@ class PreviewBar {
|
|||||||
this.chapterGroups = this.unfilteredChapterGroups;
|
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
|
// Create it from cloning
|
||||||
let createFromScratch = false;
|
let createFromScratch = false;
|
||||||
if (!this.customChaptersBar || !this.progressBar.contains(this.customChaptersBar)) {
|
if (!this.customChaptersBar || !this.progressBar.contains(this.customChaptersBar)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user