1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 18:00:18 +01:00

fix ens error text on mainnet (#9314)

This commit is contained in:
Patryk Łucka 2020-08-27 00:56:14 +02:00 committed by GitHub
parent 9e6ba089d9
commit 20b0e66cc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,6 +9,7 @@ import networkMap from 'ethereum-ens-network-map'
import log from 'loglevel'
import { ellipsify } from '../../send.utils'
import { isValidDomainName, isValidAddress, isValidAddressHead } from '../../../../helpers/utils/util'
import { MAINNET_NETWORK_ID } from '../../../../../../app/scripts/controllers/network/enums'
// Local Constants
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
@ -78,6 +79,7 @@ export default class EnsInput extends Component {
}
lookupEnsName = (ensName) => {
const { network } = this.props
const recipient = ensName.trim()
log.info(`ENS attempting to resolve name: ${recipient}`)
@ -93,7 +95,7 @@ export default class EnsInput extends Component {
})
.catch((reason) => {
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 {
log.error(reason)
this.props.updateEnsResolutionError(reason.message)