From f1498d51fa725741a2f12c84e7286223fc854fa2 Mon Sep 17 00:00:00 2001 From: Ajay Date: Sun, 2 Oct 2022 21:45:00 -0400 Subject: [PATCH] Disable show info message if chapter enabled --- src/content.ts | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/content.ts b/src/content.ts index 19580af0..a488b3e4 100644 --- a/src/content.ts +++ b/src/content.ts @@ -951,21 +951,23 @@ async function sponsorsLookup(keepOldSubmissions = true) { if (!showChapterMessage && Config.config.showChapterInfoMessage - && Config.config.payments.freeAccess - && !utils.getCategorySelection("chapter")) { + && Config.config.payments.freeAccess) { Config.config.showChapterInfoMessage = false; - const prependElement = document.querySelector(".ytp-chrome-bottom") as HTMLElement; - if (prependElement) { - Config.config.showChapterInfoMessage = false; - new Tooltip({ - text: chrome.i18n.getMessage("chapterNewFeature2"), - linkOnClick: () => void chrome.runtime.sendMessage({ "message": "openConfig" }), - referenceNode: prependElement.parentElement, - prependElement, - timeout: 1500, - leftOffset: "20px", - positionRealtive: false - }); + + if (!utils.getCategorySelection("chapter")) { + const prependElement = document.querySelector(".ytp-chrome-bottom") as HTMLElement; + if (prependElement) { + Config.config.showChapterInfoMessage = false; + new Tooltip({ + text: chrome.i18n.getMessage("chapterNewFeature2"), + linkOnClick: () => void chrome.runtime.sendMessage({ "message": "openConfig" }), + referenceNode: prependElement.parentElement, + prependElement, + timeout: 1500, + leftOffset: "20px", + positionRealtive: false + }); + } } }