From 160924feee25fd2a0f4e7a5daa683c55172f48f0 Mon Sep 17 00:00:00 2001 From: Ajay Date: Fri, 11 Aug 2023 12:08:19 -0400 Subject: [PATCH] Update maze utils to improve performance on Invidious, and fix preview bar error thanks @raphj --- maze-utils | 2 +- src/js-components/previewBar.ts | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/maze-utils b/maze-utils index 66fa2dc6..d23dbf3a 160000 --- a/maze-utils +++ b/maze-utils @@ -1 +1 @@ -Subproject commit 66fa2dc6249167f2b827b0fd96623f9f15ff3ce1 +Subproject commit d23dbf3add5c6b64b837da4bc01672a6ee75fb40 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 []; }