From de85d9360281fef429766ccc7e50cdbdb0a8daae Mon Sep 17 00:00:00 2001 From: Ajay Date: Sun, 3 Jul 2022 23:50:18 -0400 Subject: [PATCH] Hide chapter chevron when it won't do anything --- src/js-components/previewBar.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/js-components/previewBar.ts b/src/js-components/previewBar.ts index d3b47de7..9f587b42 100644 --- a/src/js-components/previewBar.ts +++ b/src/js-components/previewBar.ts @@ -217,7 +217,14 @@ class PreviewBar { this.container.appendChild(bar); } - this.createChaptersBar(segments.sort((a, b) => a.segment[0] - b.segment[0])) + this.createChaptersBar(segments.sort((a, b) => a.segment[0] - b.segment[0])); + + const chapterChevron = document.querySelector(".ytp-chapter-title-chevron") as HTMLElement; + if (!Config.config.renderAsChapters || segments.some((segment) => segment.source === SponsorSourceType.YouTube)) { + chapterChevron.style.removeProperty("display"); + } else { + chapterChevron.style.display = "none"; + } } createBar(barSegment: PreviewBarSegment): HTMLLIElement {