aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorAjay <[email protected]>2022-10-07 12:02:14 -0400
committerAjay <[email protected]>2022-10-07 12:02:14 -0400
commitdabc63af735580b5656fcab92fb365906f7a3728 (patch)
tree09a2caf17969b0de986c705cf500b9d5f4b15019 /src
parent08181c1d5feda9df1aaeb95b7e4d4419819c2ab6 (diff)
downloadSponsorBlock-dabc63af735580b5656fcab92fb365906f7a3728.tar.gz
SponsorBlock-dabc63af735580b5656fcab92fb365906f7a3728.zip
Deletew all custom chapter bars we don't know about when clearing preview bar
Diffstat (limited to 'src')
-rw-r--r--src/js-components/previewBar.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/js-components/previewBar.ts b/src/js-components/previewBar.ts
index 1de04412..24251c09 100644
--- a/src/js-components/previewBar.ts
+++ b/src/js-components/previewBar.ts
@@ -218,6 +218,12 @@ class PreviewBar {
if (this.customChaptersBar) this.customChaptersBar.style.display = "none";
this.originalChapterBar?.style?.removeProperty("display");
this.chapterVote?.setVisibility(false);
+
+ document.querySelectorAll(`.sponsorBlockChapterBar`).forEach((e) => {
+ if (e !== this.customChaptersBar) {
+ e.remove();
+ }
+ });
}
set(segments: PreviewBarSegment[], videoDuration: number): void {