From 2e9ddc7f0cde134642f2a6504b09a98f12515094 Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Sun, 28 Apr 2024 14:21:43 +0800 Subject: [PATCH] use texts.symbols to modify the extension icon --- scripts/GUI/entrypoints/icons.js | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/scripts/GUI/entrypoints/icons.js b/scripts/GUI/entrypoints/icons.js index ce02d64..bff4f24 100644 --- a/scripts/GUI/entrypoints/icons.js +++ b/scripts/GUI/entrypoints/icons.js @@ -1,34 +1,22 @@ import BrowserIcon from '/scripts/GUI/extensionIcon.js'; import Image from '/scripts/mapping/image.js'; import Tabs from '/scripts/GUI/tabs.js'; +import texts from "/scripts/mapping/read.js"; import {session} from '/scripts/secretariat.js'; class IconIndicator { - /* - Update the icon. - - @param {string} state The state to update the icon to. - */ - static update(state = false) { - (Image.get(((state) ? `default` : 'disabled'))).then((ICON) => { - (Tabs.query(null, 0)).then((DATA) => { - BrowserIcon.set({"Icon": ICON}); - }); - }) - } - /* Indicate that the website is supported through icon change. */ static async enable() { - IconIndicator.update(true); + BrowserIcon.set({"BadgeText": await (new texts(`extensionIcon_website_loading`)).symbol}); } /* Indicate that the website isn't supported through icon change. */ static async disable() { - IconIndicator.update(false); + BrowserIcon.set({"BadgeText": await (new texts(`extensionIcon_website_unsupported`)).symbol}); } }