address selector: complete reverses by name as well
This commit is contained in:
parent
38734c92c2
commit
f05ffd2e09
@ -31,18 +31,26 @@ export default class AddressSelectStore {
|
|||||||
|
|
||||||
initValues = [];
|
initValues = [];
|
||||||
regLookups = [
|
regLookups = [
|
||||||
(address) => {
|
(query) => {
|
||||||
address = address.toLowerCase().trim();
|
query = query.toLowerCase().trim();
|
||||||
if (address.length === 0 || address === '0x') {
|
if (query.length === 0 || query === '0x') {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
let name = this.reverse[address];
|
let address;
|
||||||
|
let name = this.reverse[query];
|
||||||
|
|
||||||
if (!name) {
|
if (!name) {
|
||||||
const addr = Object
|
const addr = Object
|
||||||
.keys(this.reverse)
|
.keys(this.reverse)
|
||||||
.find((addr) => addr.toLowerCase().slice(0, address.length) === address);
|
.find((addr) => {
|
||||||
|
if (addr.toLowerCase().slice(0, query.length) === query) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
const name = this.reverse[addr];
|
||||||
|
return name.toLowerCase().slice(0, query.length) === query;
|
||||||
|
});
|
||||||
|
|
||||||
if (addr) {
|
if (addr) {
|
||||||
address = addr;
|
address = addr;
|
||||||
|
Loading…
Reference in New Issue
Block a user