address selector: unique registry results

This commit is contained in:
Jannis R 2017-01-09 14:24:04 +01:00
parent f05ffd2e09
commit 8c2aa4d87c
No known key found for this signature in database
GPG Key ID: 0FE83946296A88A5

View File

@ -16,7 +16,7 @@
import React from 'react';
import { observable, action } from 'mobx';
import { flatMap } from 'lodash';
import { flatMap, uniqBy } from 'lodash';
import { FormattedMessage } from 'react-intl';
import Contracts from '~/contracts';
@ -239,6 +239,8 @@ export default class AddressSelectStore {
.filter((result) => result && !ZERO.test(result.address));
})
.then((results) => {
results = uniqBy(results, (result) => result.address);
this.registryValues = results
.map((result) => {
const lowercaseAddress = result.address.toLowerCase();