address selector: simple completion for reversed addresses

This commit is contained in:
Jannis R 2017-01-05 18:21:15 +01:00
parent 71e80f10d8
commit 2aa76e5acc
No known key found for this signature in database
GPG Key ID: 0FE83946296A88A5

View File

@ -32,10 +32,23 @@ export default class AddressSelectStore {
initValues = [];
regLookups = [
(address) => {
const name = this.reverse[address];
if (address.length === 0 || address === '0x') {
return null;
}
let name = this.reverse[address];
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 {