aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app
diff options
context:
space:
mode:
authorKevin Serrano <kevin.serrano@consensys.net>2017-06-13 07:56:37 +0800
committerKevin Serrano <kevin.serrano@consensys.net>2017-06-13 07:56:37 +0800
commit5e03b69892375b24bf6b7a59bb3379aac2c126da (patch)
treeae9559fb3c6a7d1759d832b028c43e78f2d3b683 /ui/app
parent33a32bb06be408d197d2f7784d9c1a9e04280fda (diff)
downloadtangerine-wallet-browser-5e03b69892375b24bf6b7a59bb3379aac2c126da.tar
tangerine-wallet-browser-5e03b69892375b24bf6b7a59bb3379aac2c126da.tar.gz
tangerine-wallet-browser-5e03b69892375b24bf6b7a59bb3379aac2c126da.tar.bz2
tangerine-wallet-browser-5e03b69892375b24bf6b7a59bb3379aac2c126da.tar.lz
tangerine-wallet-browser-5e03b69892375b24bf6b7a59bb3379aac2c126da.tar.xz
tangerine-wallet-browser-5e03b69892375b24bf6b7a59bb3379aac2c126da.tar.zst
tangerine-wallet-browser-5e03b69892375b24bf6b7a59bb3379aac2c126da.zip
Fix check icon appearing in inappropriate situations.
Diffstat (limited to 'ui/app')
-rw-r--r--ui/app/components/ens-input.js17
1 files changed, 4 insertions, 13 deletions
diff --git a/ui/app/components/ens-input.js b/ui/app/components/ens-input.js
index 43bb7ab22..52ad8943b 100644
--- a/ui/app/components/ens-input.js
+++ b/ui/app/components/ens-input.js
@@ -21,7 +21,6 @@ EnsInput.prototype.render = function () {
const opts = extend(props, {
list: 'addresses',
onChange: () => {
- this.setState({ ensResolution: '0x0000000000000000000000000000000000000000' })
const network = this.props.network
const networkHasEnsSupport = getNetworkEnsSupport(network)
if (!networkHasEnsSupport) return
@@ -73,6 +72,7 @@ EnsInput.prototype.render = function () {
EnsInput.prototype.componentDidMount = function () {
const network = this.props.network
const networkHasEnsSupport = getNetworkEnsSupport(network)
+ this.setState({ ensResolution: '0x0000000000000000000000000000000000000000' })
if (networkHasEnsSupport) {
const provider = global.ethereumProvider
@@ -85,14 +85,6 @@ EnsInput.prototype.lookupEnsName = function () {
const recipient = document.querySelector('input[name="address"]').value
const { ensResolution } = this.state
- if (!this.ens) {
- return this.setState({
- loadingEns: false,
- ensFailure: true,
- hoverText: 'ENS is not supported on your current network.',
- })
- }
-
log.info(`ENS attempting to resolve name: ${recipient}`)
this.ens.lookup(recipient.trim())
.then((address) => {
@@ -124,7 +116,7 @@ EnsInput.prototype.componentDidUpdate = function (prevProps, prevState) {
// If an address is sent without a nickname, meaning not from ENS or from
// the user's own accounts, a default of a one-space string is used.
const nickname = state.nickname || ' '
- if (ensResolution && this.props.onChange &&
+ if (prevState && ensResolution && this.props.onChange &&
ensResolution !== prevState.ensResolution) {
this.props.onChange(ensResolution, nickname)
}
@@ -143,7 +135,7 @@ EnsInput.prototype.ensIcon = function (recipient) {
}
EnsInput.prototype.ensIconContents = function (recipient) {
- const { loadingEns, ensFailure, ensResolution } = this.state || {}
+ const { loadingEns, ensFailure, ensResolution } = this.state || { ensResolution: '0x0000000000000000000000000000000000000000'}
if (loadingEns) {
return h('img', {
@@ -160,7 +152,7 @@ EnsInput.prototype.ensIconContents = function (recipient) {
return h('i.fa.fa-warning.fa-lg.warning')
}
- if (ensResolution) {
+ if (ensResolution && (ensResolution !== '0x0000000000000000000000000000000000000000')) {
return h('i.fa.fa-check-circle.fa-lg.cursor-pointer', {
style: { color: 'green' },
onClick: (event) => {
@@ -175,4 +167,3 @@ EnsInput.prototype.ensIconContents = function (recipient) {
function getNetworkEnsSupport (network) {
return Boolean(networkMap[network])
}
-