From 52f7a29969ddce73fd31c64e2e13159318654fb8 Mon Sep 17 00:00:00 2001 From: buzzcode2007 <73412182+buzz_lightsnack_2007@users.noreply.github.com> Date: Tue, 2 Apr 2024 16:39:46 +0800 Subject: [PATCH] Fix import error and update standby state recording --- scripts/watchman.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/watchman.js b/scripts/watchman.js index 84c37b9..f4bfa8c 100644 --- a/scripts/watchman.js +++ b/scripts/watchman.js @@ -7,7 +7,7 @@ Be sensitive to changes and update the state. let secretariat = await import( chrome.runtime.getURL("scripts/secretariat.js") ); - let filters = (await import(chrome.runtime.getURL("scripts/filters.js"))).default; + let filters = new ((await import(chrome.runtime.getURL("scripts/filters.js"))).default); // let reader = await import(chrome.runtime.getURL("scripts/reader.js")); class watchman { @@ -34,15 +34,15 @@ Be sensitive to changes and update the state. console.log( "ShopAI works here! Click on the button in the toolbar or website to start.", ); + secretariat.write("state", true); // TODO } /* Set the program to standby utnil next load. */ static standby() { - console.log( - "ShopAI doesn't work here (yet). Expecting something? Try checking your filters. If you know what you're doing, feel free to create a filter yourself.", - ); + // Set the icon to indicate that it's not active. + secretariat.write("state", false); } static async job() {