reset custom chapters bar to null when deleting

This commit is contained in:
Ajay 2022-09-23 11:04:55 -04:00
parent e11a320c3f
commit e1688c3f58

View file

@ -314,11 +314,11 @@ class PreviewBar {
createChaptersBar(segments: PreviewBarSegment[]): void {
if (!this.progressBar || !this.originalChapterBar || this.originalChapterBar.childElementCount <= 0) {
if (this.customChaptersBar) this.customChaptersBar.style.display = "none";
if (this.originalChapterBar) this.originalChapterBar.style.removeProperty("display");
// Make sure other video types lose their chapter bar
document.querySelectorAll(".sponsorBlockChapterBar").forEach((element) => element.remove());
this.customChaptersBar = null;
return;
}