address selector: simple completion for reversed addresses
This commit is contained in:
parent
71e80f10d8
commit
2aa76e5acc
@ -32,11 +32,24 @@ export default class AddressSelectStore {
|
|||||||
initValues = [];
|
initValues = [];
|
||||||
regLookups = [
|
regLookups = [
|
||||||
(address) => {
|
(address) => {
|
||||||
const name = this.reverse[address];
|
if (address.length === 0 || address === '0x') {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
let name = this.reverse[address];
|
||||||
|
|
||||||
if (!name) {
|
if (!name) {
|
||||||
|
const addr = Object
|
||||||
|
.keys(this.reverse)
|
||||||
|
.find((addr) => addr.slice(0, address.length) === address);
|
||||||
|
|
||||||
|
if (addr) {
|
||||||
|
address = addr;
|
||||||
|
name = this.reverse[addr];
|
||||||
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
address,
|
address,
|
||||||
|
Loading…
Reference in New Issue
Block a user