1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Update asset page etherscan link to the address-filtered token page on Etherscan (#9909)

This commit is contained in:
Dan J Miller 2020-11-18 21:57:29 -03:30 committed by GitHub
parent 5be20d105e
commit 179e795b1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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}