Skip to content

Commit 08181c1

Browse files
committed
Clear bote buttons when clearing preview bar
1 parent 03cd1b5 commit 08181c1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/js-components/previewBar.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ class PreviewBar {
217217

218218
if (this.customChaptersBar) this.customChaptersBar.style.display = "none";
219219
this.originalChapterBar?.style?.removeProperty("display");
220+
this.chapterVote?.setVisibility(false);
220221
}
221222

222223
set(segments: PreviewBarSegment[], videoDuration: number): void {
@@ -770,8 +771,8 @@ class PreviewBar {
770771
const chapterTitle = chaptersContainer.querySelector(".ytp-chapter-title-content") as HTMLDivElement;
771772
chapterTitle.innerText = chosenSegment.description || shortCategoryName(chosenSegment.category);
772773

773-
const chapterVoteContainer = this.chapterVote.getContainer();
774774
if (chosenSegment.source === SponsorSourceType.Server) {
775+
const chapterVoteContainer = this.chapterVote.getContainer();
775776
if (!chapterButton.contains(chapterVoteContainer)) {
776777
const oldVoteContainers = document.querySelectorAll("#chapterVote");
777778
if (oldVoteContainers.length > 0) {

0 commit comments

Comments
 (0)