From e7a4a991d5cae9848982e9123f1de3a33326b98f Mon Sep 17 00:00:00 2001 From: Manvel Saroyan Date: Fri, 29 Mar 2024 12:13:09 -0300 Subject: [PATCH] issue #118 - remove bg-inject from UI --- src/js/ui/ActionInputs.js | 13 ++++++++----- src/js/ui/actionsTypes.js | 5 ----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/js/ui/ActionInputs.js b/src/js/ui/ActionInputs.js index c38a384..2d03b47 100644 --- a/src/js/ui/ActionInputs.js +++ b/src/js/ui/ActionInputs.js @@ -118,11 +118,14 @@ class ActionInputs { } setTooltipInfo() { - const {link, description, name} = actionTypes.filter(({name}) => name === this._type)[0]; - const heading = name; - const text = description; - const linkText = "Learn more"; - this.tooltip.setData({heading, text, link, linkText}); + const action = actionTypes.filter(({name}) => name === this._type)[0]; + if (action) { + const {link, description, name} = action; + const heading = name; + const text = description; + const linkText = "Learn more"; + this.tooltip.setData({heading, text, link, linkText}); + } } reset() { diff --git a/src/js/ui/actionsTypes.js b/src/js/ui/actionsTypes.js index 2e983cf..369f736 100644 --- a/src/js/ui/actionsTypes.js +++ b/src/js/ui/actionsTypes.js @@ -29,11 +29,6 @@ const actionTypes = [ description: "Injects javascript code into the content script.", link: `${website}/inject-cs` }, - { - name: "bg-inject", - description: "Inject script into backroung page of the extension.", - link: `${website}/bg-inject` - }, { name: "bg-function", description: "Predefined scripts that are executed in the context of the background page.",