mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
fix ens error text on mainnet (#9314)
This commit is contained in:
parent
9e6ba089d9
commit
20b0e66cc9
@ -9,6 +9,7 @@ import networkMap from 'ethereum-ens-network-map'
|
|||||||
import log from 'loglevel'
|
import log from 'loglevel'
|
||||||
import { ellipsify } from '../../send.utils'
|
import { ellipsify } from '../../send.utils'
|
||||||
import { isValidDomainName, isValidAddress, isValidAddressHead } from '../../../../helpers/utils/util'
|
import { isValidDomainName, isValidAddress, isValidAddressHead } from '../../../../helpers/utils/util'
|
||||||
|
import { MAINNET_NETWORK_ID } from '../../../../../../app/scripts/controllers/network/enums'
|
||||||
|
|
||||||
// Local Constants
|
// Local Constants
|
||||||
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
|
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
|
||||||
@ -78,6 +79,7 @@ export default class EnsInput extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lookupEnsName = (ensName) => {
|
lookupEnsName = (ensName) => {
|
||||||
|
const { network } = this.props
|
||||||
const recipient = ensName.trim()
|
const recipient = ensName.trim()
|
||||||
|
|
||||||
log.info(`ENS attempting to resolve name: ${recipient}`)
|
log.info(`ENS attempting to resolve name: ${recipient}`)
|
||||||
@ -93,7 +95,7 @@ export default class EnsInput extends Component {
|
|||||||
})
|
})
|
||||||
.catch((reason) => {
|
.catch((reason) => {
|
||||||
if (isValidDomainName(recipient) && reason.message === 'ENS name not defined.') {
|
if (isValidDomainName(recipient) && reason.message === 'ENS name not defined.') {
|
||||||
this.props.updateEnsResolutionError(this.context.t('ensNotFoundOnCurrentNetwork'))
|
this.props.updateEnsResolutionError(network === MAINNET_NETWORK_ID ? this.context.t('noAddressForName') : this.context.t('ensNotFoundOnCurrentNetwork'))
|
||||||
} else {
|
} else {
|
||||||
log.error(reason)
|
log.error(reason)
|
||||||
this.props.updateEnsResolutionError(reason.message)
|
this.props.updateEnsResolutionError(reason.message)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user