diff options
Diffstat (limited to 'src/help.ts')
-rw-r--r-- | src/help.ts | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/help.ts b/src/help.ts index 3b8c636b..67296473 100644 --- a/src/help.ts +++ b/src/help.ts @@ -3,6 +3,7 @@ import Config from "./config"; import { showDonationLink } from "./utils/configUtils"; import { waitFor } from "../maze-utils/src"; +import { isDeArrowInstalled } from "./utils/crossExtension"; if (document.readyState === "complete") { init(); @@ -10,6 +11,32 @@ if (document.readyState === "complete") { document.addEventListener("DOMContentLoaded", init); } +// DeArrow promotion +waitFor(() => Config.isReady()).then(() => { + if (Config.config.showNewFeaturePopups && Config.config.showUpsells) { + isDeArrowInstalled().then((installed) => { + if (!installed) { + const deArrowPromotion = document.getElementById("dearrow-link"); + deArrowPromotion.classList.remove("hidden"); + + deArrowPromotion.addEventListener("click", () => Config.config.showDeArrowPromotion = false); + + const text = deArrowPromotion.querySelector("#dearrow-link-text"); + text.textContent = `${chrome.i18n.getMessage("DeArrowPromotionMessage2").split("?")[0]}? ${chrome.i18n.getMessage("DeArrowPromotionMessage3")}`; + + const closeButton = deArrowPromotion.querySelector(".close-button"); + closeButton.addEventListener("click", (e) => { + e.preventDefault(); + + deArrowPromotion.classList.add("hidden"); + Config.config.showDeArrowPromotion = false; + Config.config.showDeArrowInSettings = false; + }); + } + }); + } +}); + async function init() { localizeHtmlPage(); |