aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components
diff options
context:
space:
mode:
authorAlex Ivasyuv <industral@gmail.com>2019-05-15 03:00:53 +0800
committerAlex Ivasyuv <industral@gmail.com>2019-05-15 03:00:53 +0800
commitc8cb4ba3705478a16cd1e39f8edc1f277bb2ede6 (patch)
treee22e1efce0f018ebd4bf36037790ff92cf535ee5 /ui/app/components
parent3b01ba8741543d54bd2c3aad6a8ea0ef352e8924 (diff)
downloadtangerine-wallet-browser-c8cb4ba3705478a16cd1e39f8edc1f277bb2ede6.tar
tangerine-wallet-browser-c8cb4ba3705478a16cd1e39f8edc1f277bb2ede6.tar.gz
tangerine-wallet-browser-c8cb4ba3705478a16cd1e39f8edc1f277bb2ede6.tar.bz2
tangerine-wallet-browser-c8cb4ba3705478a16cd1e39f8edc1f277bb2ede6.tar.lz
tangerine-wallet-browser-c8cb4ba3705478a16cd1e39f8edc1f277bb2ede6.tar.xz
tangerine-wallet-browser-c8cb4ba3705478a16cd1e39f8edc1f277bb2ede6.tar.zst
tangerine-wallet-browser-c8cb4ba3705478a16cd1e39f8edc1f277bb2ede6.zip
fixed #5524
Diffstat (limited to 'ui/app/components')
-rw-r--r--ui/app/components/app/ens-input.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/ui/app/components/app/ens-input.js b/ui/app/components/app/ens-input.js
index 5eea0dd90..f17f6c3d6 100644
--- a/ui/app/components/app/ens-input.js
+++ b/ui/app/components/app/ens-input.js
@@ -41,12 +41,15 @@ EnsInput.prototype.onChange = function (recipient) {
ensResolution: null,
ensFailure: null,
toError: null,
+ recipient,
})
}
this.setState({
loadingEns: true,
+ recipient,
})
+
this.checkName(recipient)
}
@@ -56,6 +59,7 @@ EnsInput.prototype.render = function () {
list: 'addresses',
onChange: this.onChange.bind(this),
qrScanner: true,
+ recipient: (this.state || {}).recipient,
})
return h('div', {
style: { width: '100%', position: 'relative' },
@@ -79,19 +83,21 @@ EnsInput.prototype.componentDidMount = function () {
EnsInput.prototype.lookupEnsName = function (recipient) {
const { ensResolution } = this.state
+ recipient = recipient.trim()
log.info(`ENS attempting to resolve name: ${recipient}`)
- this.ens.lookup(recipient.trim())
+ this.ens.lookup(recipient)
.then((address) => {
if (address === ZERO_ADDRESS) throw new Error(this.context.t('noAddressForName'))
if (address !== ensResolution) {
this.setState({
loadingEns: false,
ensResolution: address,
- nickname: recipient.trim(),
+ nickname: recipient,
hoverText: address + '\n' + this.context.t('clickCopy'),
ensFailure: false,
toError: null,
+ recipient,
})
}
})
@@ -101,11 +107,11 @@ EnsInput.prototype.lookupEnsName = function (recipient) {
ensResolution: recipient,
ensFailure: true,
toError: null,
+ recipient: null,
}
if (isValidENSAddress(recipient) && reason.message === 'ENS name not defined.') {
setStateObj.hoverText = this.context.t('ensNameNotFound')
setStateObj.toError = 'ensNameNotFound'
- setStateObj.ensFailure = false
} else {
log.error(reason)
setStateObj.hoverText = reason.message
@@ -128,7 +134,7 @@ EnsInput.prototype.componentDidUpdate = function (prevProps, prevState) {
}
if (prevState && ensResolution && this.props.onChange &&
ensResolution !== prevState.ensResolution) {
- this.props.onChange({ toAddress: ensResolution, nickname, toError: state.toError, toWarning: state.toWarning })
+ this.props.onChange({ toAddress: ensResolution, recipient: state.recipient, nickname, toError: state.toError, toWarning: state.toWarning })
}
}