address selector: simple completion for reversed addresses
This commit is contained in:
parent
71e80f10d8
commit
2aa76e5acc
@ -32,10 +32,23 @@ 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) {
|
||||||
return null;
|
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 {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user