Skip to content

Commit

Permalink
v0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
VenkatTeja committed Aug 29, 2023
1 parent e5bf66a commit 9d29d92
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 21 deletions.
2 changes: 1 addition & 1 deletion chrome-extension/public/manifest.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
30 changes: 10 additions & 20 deletions chrome-extension/src/inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) => `<li>${i}</li>`)
Expand All @@ -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)) {
Expand Down

0 comments on commit 9d29d92

Please sign in to comment.