From 12f9562aa63f7ee29c03d6f36d0c5608a7165957 Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Mon, 22 Apr 2024 16:40:24 +0800 Subject: [PATCH] set the side panel's trigger behavior Add the module "user_actions.js" to the GUI scripts folder. This module will handle the user's actions, such as opening the side panel. --- scripts/GUI/user_actions.js | 7 +++++++ scripts/shopAI.js | 2 ++ 2 files changed, 9 insertions(+) create mode 100644 scripts/GUI/user_actions.js diff --git a/scripts/GUI/user_actions.js b/scripts/GUI/user_actions.js new file mode 100644 index 0000000..63f9e59 --- /dev/null +++ b/scripts/GUI/user_actions.js @@ -0,0 +1,7 @@ +export default class user_actions { + static init() { + chrome.sidePanel + .setPanelBehavior({ openPanelOnActionClick: true }) + .catch((error) => console.error(error)); + }; +}; \ No newline at end of file diff --git a/scripts/shopAI.js b/scripts/shopAI.js index 63f4dc4..3e15a09 100644 --- a/scripts/shopAI.js +++ b/scripts/shopAI.js @@ -3,5 +3,7 @@ Shop wisely with AI! */ import fc from './fc.js'; +import user_actions from "./GUI/user_actions.js"; fc.run(); +user_actions.init(); \ No newline at end of file