From 20b0e66cc978f8fc22db31f08c3e025309c00b62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20=C5=81ucka?= Date: Thu, 27 Aug 2020 00:56:14 +0200 Subject: [PATCH] fix ens error text on mainnet (#9314) --- .../send/send-content/add-recipient/ens-input.component.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/app/pages/send/send-content/add-recipient/ens-input.component.js b/ui/app/pages/send/send-content/add-recipient/ens-input.component.js index c3dce42d8..ccbfed356 100644 --- a/ui/app/pages/send/send-content/add-recipient/ens-input.component.js +++ b/ui/app/pages/send/send-content/add-recipient/ens-input.component.js @@ -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)