Commit ae50d269 authored by Noah Zinsmeister's avatar Noah Zinsmeister Committed by GitHub

fix ens stuff again (#407)

parent 9a1b4345
......@@ -96,6 +96,7 @@ export default function AddressInputPanel({ title, initialInput = '', onChange =
let stale = false
if (isAddress(debouncedInput)) {
try {
library
.lookupAddress(debouncedInput)
.then(name => {
......@@ -110,11 +111,18 @@ export default function AddressInputPanel({ title, initialInput = '', onChange =
}
})
.catch(() => {
if (!stale) {
setData({ address: debouncedInput, name: '' })
setError(null)
}
})
} catch {
setData({ address: debouncedInput, name: '' })
setError(null)
}
} else {
if (debouncedInput !== '') {
try {
library
.resolveName(debouncedInput)
.then(address => {
......@@ -129,8 +137,13 @@ export default function AddressInputPanel({ title, initialInput = '', onChange =
}
})
.catch(() => {
if (!stale) {
setError(true)
}
})
} catch {
setError(true)
}
}
}
......
......@@ -69,10 +69,8 @@ export function useENSName(address) {
}
})
} catch {
if (!stale) {
setENSNname(null)
}
}
return () => {
stale = true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment