From 9d29d9251eb78345aee8e966f66d2a42157f9d0e Mon Sep 17 00:00:00 2001 From: Venkat Kunisetty Date: Tue, 29 Aug 2023 20:55:43 +0530 Subject: [PATCH] v0.3.1 --- chrome-extension/public/manifest.json | 2 +- chrome-extension/src/inject.js | 30 +++++++++------------------ 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/chrome-extension/public/manifest.json b/chrome-extension/public/manifest.json index 6533a8f..c8a19d6 100644 --- a/chrome-extension/public/manifest.json +++ b/chrome-extension/public/manifest.json @@ -1,7 +1,7 @@ { "name": "Web3 Vigilance - Browser security", "description": "Protect yourself from new websites against potential scams, frauds & phishing sites. Maintained by a blockchain org 'Vigilance DAO'", - "version": "0.3.0", + "version": "0.3.1", "icons": { "16": "images/icon16.png", "32": "images/icon32.png", diff --git a/chrome-extension/src/inject.js b/chrome-extension/src/inject.js index e846704..8befef5 100644 --- a/chrome-extension/src/inject.js +++ b/chrome-extension/src/inject.js @@ -19,7 +19,7 @@ const env = { // host: "http://localhost:4000", }; -const ContractInfoAPIURL = env.host.concat("/contract-infoo"); +const ContractInfoAPIURL = env.host.concat("/contract-info"); /** * @param {import("./inject").MetaMaskRequest} params @@ -456,34 +456,27 @@ function populateFinancialAlertWithData(alertInfo) { drainedAccountsValueElement.dataset["priority"] = alertInfo.drainedAccountsValue.toLowerCase(); - if (!(feedbackContainerElement instanceof HTMLDetailsElement)) { - return; - } - feedbackContainerElement.addEventListener("toggle", () => { - if (!feedbackContainerElement.open) { + // hide feedback-icon if feedback is empty + feedbackIconElement.classList.toggle( + "hidden", + alertInfo.feedback.length == 0 + ); + feedbackIconElement.addEventListener("click", () => { + if (!(feedbackContainerElement instanceof HTMLDetailsElement)) { return; } sendEvent({ eventName: "Contract Alert Risk Expanded", }); - }); + feedbackContainerElement.open = !feedbackContainerElement.open; + }); feedbackContainerElement.classList.toggle( "hidden", alertInfo.feedback.length == 0 ); - // hide feedback-icon if feedback is empty - feedbackIconElement.classList.toggle( - "hidden", - alertInfo.feedback.length == 0 - ); - - feedbackIconElement.addEventListener("click", () => { - feedbackContainerElement.open = !feedbackContainerElement.open; - }); - if (alertInfo.feedback.length != 0) { feedbackListElement.innerHTML = alertInfo.feedback .map((i) => `
  • ${i}
  • `) @@ -494,9 +487,6 @@ function populateFinancialAlertWithData(alertInfo) { closeButton.addEventListener("click", alertInfo.cancelButtonClickListener); reportButton.addEventListener("click", () => { formElement.classList.toggle("hidden"); - sendEvent({ - eventName: "Contract Alert Report Button Clicked", - }); }); if (!(formElement instanceof HTMLFormElement)) {