aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorAjay <[email protected]>2022-07-03 23:50:18 -0400
committerAjay <[email protected]>2022-07-03 23:50:18 -0400
commitde85d9360281fef429766ccc7e50cdbdb0a8daae (patch)
treec545348189210b99118d4a9e7c874ecc3e2ccc20 /src
parent7badfd9b325088ec9a7a203486580b6168724d3a (diff)
downloadSponsorBlock-de85d9360281fef429766ccc7e50cdbdb0a8daae.tar.gz
SponsorBlock-de85d9360281fef429766ccc7e50cdbdb0a8daae.zip
Hide chapter chevron when it won't do anything
Diffstat (limited to 'src')
-rw-r--r--src/js-components/previewBar.ts9
1 files changed, 8 insertions, 1 deletions
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 {