Clear bote buttons when clearing preview bar

This commit is contained in:
Ajay
2022-10-07 11:59:56 -04:00
parent 03cd1b535b
commit 08181c1d5f

View File

@@ -217,6 +217,7 @@ class PreviewBar {
if (this.customChaptersBar) this.customChaptersBar.style.display = "none";
this.originalChapterBar?.style?.removeProperty("display");
this.chapterVote?.setVisibility(false);
}
set(segments: PreviewBarSegment[], videoDuration: number): void {
@@ -770,8 +771,8 @@ class PreviewBar {
const chapterTitle = chaptersContainer.querySelector(".ytp-chapter-title-content") as HTMLDivElement;
chapterTitle.innerText = chosenSegment.description || shortCategoryName(chosenSegment.category);
const chapterVoteContainer = this.chapterVote.getContainer();
if (chosenSegment.source === SponsorSourceType.Server) {
const chapterVoteContainer = this.chapterVote.getContainer();
if (!chapterButton.contains(chapterVoteContainer)) {
const oldVoteContainers = document.querySelectorAll("#chapterVote");
if (oldVoteContainers.length > 0) {