From 2122b8cf1657e16d6ee564d47506a3c06e6beb9f Mon Sep 17 00:00:00 2001 From: Austin Akers Date: Wed, 17 Feb 2021 05:15:30 -0800 Subject: [PATCH] Hide links to etherscan when no block explorer is specified for a custom network (#10455) Conditionally render view on Etherscan text if it's a custom network Fixes: #5631 --- app/scripts/platforms/extension.js | 4 +++- package.json | 2 +- yarn.lock | 8 ++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/scripts/platforms/extension.js b/app/scripts/platforms/extension.js index 8c43a343b..98196c946 100644 --- a/app/scripts/platforms/extension.js +++ b/app/scripts/platforms/extension.js @@ -196,7 +196,9 @@ export default class ExtensionPlatform { const nonce = parseInt(txMeta.txParams.nonce, 16); const title = 'Confirmed transaction'; - const message = `Transaction ${nonce} confirmed! View on Etherscan`; + const message = `Transaction ${nonce} confirmed! ${ + url.length ? 'View on Etherscan' : '' + }`; this._showNotification(title, message, url); } diff --git a/package.json b/package.json index 5fcc0245a..050f4117f 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "@metamask/controllers": "^5.1.0", "@metamask/eth-ledger-bridge-keyring": "^0.2.6", "@metamask/eth-token-tracker": "^3.0.1", - "@metamask/etherscan-link": "^1.4.0", + "@metamask/etherscan-link": "^1.4.1", "@metamask/inpage-provider": "^8.0.4", "@metamask/jazzicon": "^2.0.0", "@metamask/logo": "^2.5.0", diff --git a/yarn.lock b/yarn.lock index 86fd94dde..0ca902db4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2093,10 +2093,10 @@ human-standard-token-abi "^1.0.2" safe-event-emitter "^1.0.1" -"@metamask/etherscan-link@^1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@metamask/etherscan-link/-/etherscan-link-1.4.0.tgz#4631e9beec17de26b35b3ccd643ede2bae8ed811" - integrity sha512-4Bi72Y8/FQZbfTARyv+oWKGuECzdQ37cQKt88Eu5JPDrHAcRDZt4Bt7bWC9phUBrphAr1qbCKh9S90X9hW0pZg== +"@metamask/etherscan-link@^1.4.1": + version "1.4.1" + resolved "https://registry.yarnpkg.com/@metamask/etherscan-link/-/etherscan-link-1.4.1.tgz#44377c5c9be2c02ef26aff5da74bd839e50c09f9" + integrity sha512-hs8Qi62+6BZN9J7dknnoJR4DStEP6PzWEwRt+ScEVM4CuBVo08mqY0HXRny52A6FjBQrSnBgA5gvMbBOMqDavg== "@metamask/forwarder@^1.1.0": version "1.1.0"