aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorAjay <[email protected]>2023-08-11 12:08:19 -0400
committerAjay <[email protected]>2023-08-11 12:08:19 -0400
commit160924feee25fd2a0f4e7a5daa683c55172f48f0 (patch)
treecb4d155ebc98ef7508b996254bebeab7a0224e8f /src
parente3f3ed20e690a53bde98be9bcf371a591ca102e1 (diff)
downloadSponsorBlock-160924feee25fd2a0f4e7a5daa683c55172f48f0.tar.gz
SponsorBlock-160924feee25fd2a0f4e7a5daa683c55172f48f0.zip
Update maze utils to improve performance on Invidious, and fix preview bar error
thanks @raphj
Diffstat (limited to 'src')
-rw-r--r--src/js-components/previewBar.ts12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/js-components/previewBar.ts b/src/js-components/previewBar.ts
index a3659aad..74fae236 100644
--- a/src/js-components/previewBar.ts
+++ b/src/js-components/previewBar.ts
@@ -784,11 +784,13 @@ class PreviewBar {
if (!Config.config.showSegmentNameInChapterBar
|| ((!segments || segments.length <= 0) && submittingSegments?.length <= 0)) {
const chaptersContainer = this.getChaptersContainer();
- chaptersContainer.querySelector(".sponsorChapterText")?.remove();
- const chapterTitle = chaptersContainer.querySelector(".ytp-chapter-title-content") as HTMLDivElement;
-
- chapterTitle.style.removeProperty("display");
- chaptersContainer.classList.remove("sponsorblock-chapter-visible");
+ if (chaptersContainer) {
+ chaptersContainer.querySelector(".sponsorChapterText")?.remove();
+ const chapterTitle = chaptersContainer.querySelector(".ytp-chapter-title-content") as HTMLDivElement;
+
+ chapterTitle.style.removeProperty("display");
+ chaptersContainer.classList.remove("sponsorblock-chapter-visible");
+ }
return [];
}