mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-12 22:47:18 +03:00
Don't draw chapters bar when no custom segments
This commit is contained in:
@@ -258,9 +258,10 @@ class PreviewBar {
|
|||||||
const chapterBar = document.querySelector(".ytp-chapters-container:not(.sponsorBlockChapterBar)") as HTMLElement;
|
const chapterBar = document.querySelector(".ytp-chapters-container:not(.sponsorBlockChapterBar)") as HTMLElement;
|
||||||
if (!progressBar || !chapterBar || chapterBar.childElementCount <= 0) return;
|
if (!progressBar || !chapterBar || chapterBar.childElementCount <= 0) return;
|
||||||
|
|
||||||
if (!Config.config.renderSegmentsAsChapters
|
if (segments.every((segments) => segments.source === SponsorSourceType.YouTube)
|
||||||
|
|| (!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))) {
|
||||||
if (this.customChaptersBar) this.customChaptersBar.style.display = "none";
|
if (this.customChaptersBar) this.customChaptersBar.style.display = "none";
|
||||||
chapterBar.style.removeProperty("display");
|
chapterBar.style.removeProperty("display");
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user