diff --git a/ui/app/pages/asset/components/token-asset.js b/ui/app/pages/asset/components/token-asset.js index 81198ee5d..9cbf083e6 100644 --- a/ui/app/pages/asset/components/token-asset.js +++ b/ui/app/pages/asset/components/token-asset.js @@ -2,14 +2,10 @@ import React from 'react' import PropTypes from 'prop-types' import { useDispatch, useSelector } from 'react-redux' import { useHistory } from 'react-router-dom' -import { createAccountLink } from '@metamask/etherscan-link' import TransactionList from '../../../components/app/transaction-list' import { TokenOverview } from '../../../components/app/wallet-overview' -import { - getCurrentNetworkId, - getSelectedIdentity, -} from '../../../selectors/selectors' +import { getSelectedIdentity } from '../../../selectors/selectors' import { DEFAULT_ROUTE } from '../../../helpers/constants/routes' import { showModal } from '../../../store/actions' @@ -18,10 +14,9 @@ import TokenOptions from './token-options' export default function TokenAsset({ token }) { const dispatch = useDispatch() - const network = useSelector(getCurrentNetworkId) - const selectedAccountName = useSelector( - (state) => getSelectedIdentity(state).name, - ) + const selectedIdentity = useSelector(getSelectedIdentity) + const selectedAccountName = selectedIdentity.name + const selectedAddress = selectedIdentity.address const history = useHistory() return ( @@ -36,7 +31,7 @@ export default function TokenAsset({ token }) { dispatch(showModal({ name: 'HIDE_TOKEN_CONFIRMATION', token })) } onViewEtherscan={() => { - const url = createAccountLink(token.address, network) + const url = `https://etherscan.io/token/${token.address}?a=${selectedAddress}` global.platform.openTab({ url }) }} tokenSymbol={token.symbol}