Merge pull request #3732 from ethcore/jg-duplicate-accounts
Give accounts precedence over address_book entries
This commit is contained in:
commit
de4715bc67
@ -27,7 +27,7 @@ export function personalAccountsInfo (accountsInfo) {
|
|||||||
|
|
||||||
Object.keys(accountsInfo || {})
|
Object.keys(accountsInfo || {})
|
||||||
.map((address) => Object.assign({}, accountsInfo[address], { address }))
|
.map((address) => Object.assign({}, accountsInfo[address], { address }))
|
||||||
.filter((account) => !account.meta.deleted)
|
.filter((account) => account.uuid || !account.meta.deleted)
|
||||||
.forEach((account) => {
|
.forEach((account) => {
|
||||||
if (account.uuid) {
|
if (account.uuid) {
|
||||||
accounts[account.address] = account;
|
accounts[account.address] = account;
|
||||||
|
@ -37,7 +37,7 @@ class IdentityName extends Component {
|
|||||||
render () {
|
render () {
|
||||||
const { address, accountsInfo, tokens, empty, name, shorten, unknown, className } = this.props;
|
const { address, accountsInfo, tokens, empty, name, shorten, unknown, className } = this.props;
|
||||||
const account = accountsInfo[address] || tokens[address];
|
const account = accountsInfo[address] || tokens[address];
|
||||||
const hasAccount = account && (!account.meta || !account.meta.deleted);
|
const hasAccount = account && (account.uuid || !account.meta || !account.meta.deleted);
|
||||||
|
|
||||||
if (!hasAccount && empty) {
|
if (!hasAccount && empty) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -57,7 +57,7 @@ impl<C: 'static> ParityAccounts for ParityAccountsClient<C> where C: MiningBlock
|
|||||||
let info = try!(store.accounts_info().map_err(|e| errors::account("Could not fetch account info.", e)));
|
let info = try!(store.accounts_info().map_err(|e| errors::account("Could not fetch account info.", e)));
|
||||||
let other = store.addresses_info().expect("addresses_info always returns Ok; qed");
|
let other = store.addresses_info().expect("addresses_info always returns Ok; qed");
|
||||||
|
|
||||||
Ok(info.into_iter().chain(other.into_iter()).map(|(a, v)| {
|
Ok(other.into_iter().chain(info.into_iter()).map(|(a, v)| {
|
||||||
let m = map![
|
let m = map![
|
||||||
"name".to_owned() => to_value(&v.name),
|
"name".to_owned() => to_value(&v.name),
|
||||||
"meta".to_owned() => to_value(&v.meta),
|
"meta".to_owned() => to_value(&v.meta),
|
||||||
|
Loading…
Reference in New Issue
Block a user