mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-11 05:57:07 +03:00
Clear bote buttons when clearing preview bar
This commit is contained in:
@@ -217,6 +217,7 @@ class PreviewBar {
|
|||||||
|
|
||||||
if (this.customChaptersBar) this.customChaptersBar.style.display = "none";
|
if (this.customChaptersBar) this.customChaptersBar.style.display = "none";
|
||||||
this.originalChapterBar?.style?.removeProperty("display");
|
this.originalChapterBar?.style?.removeProperty("display");
|
||||||
|
this.chapterVote?.setVisibility(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
set(segments: PreviewBarSegment[], videoDuration: number): void {
|
set(segments: PreviewBarSegment[], videoDuration: number): void {
|
||||||
@@ -770,8 +771,8 @@ class PreviewBar {
|
|||||||
const chapterTitle = chaptersContainer.querySelector(".ytp-chapter-title-content") as HTMLDivElement;
|
const chapterTitle = chaptersContainer.querySelector(".ytp-chapter-title-content") as HTMLDivElement;
|
||||||
chapterTitle.innerText = chosenSegment.description || shortCategoryName(chosenSegment.category);
|
chapterTitle.innerText = chosenSegment.description || shortCategoryName(chosenSegment.category);
|
||||||
|
|
||||||
const chapterVoteContainer = this.chapterVote.getContainer();
|
|
||||||
if (chosenSegment.source === SponsorSourceType.Server) {
|
if (chosenSegment.source === SponsorSourceType.Server) {
|
||||||
|
const chapterVoteContainer = this.chapterVote.getContainer();
|
||||||
if (!chapterButton.contains(chapterVoteContainer)) {
|
if (!chapterButton.contains(chapterVoteContainer)) {
|
||||||
const oldVoteContainers = document.querySelectorAll("#chapterVote");
|
const oldVoteContainers = document.querySelectorAll("#chapterVote");
|
||||||
if (oldVoteContainers.length > 0) {
|
if (oldVoteContainers.length > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user