From 21a3cf7b6586d3c14cc8de8dcc5a0e92b65c1d39 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Wed, 7 Dec 2016 11:44:45 +0100 Subject: [PATCH 1/3] Swap order of addressbook & acocunts merge --- rpc/src/v1/impls/parity_accounts.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpc/src/v1/impls/parity_accounts.rs b/rpc/src/v1/impls/parity_accounts.rs index ea927de4e..2631bc3ce 100644 --- a/rpc/src/v1/impls/parity_accounts.rs +++ b/rpc/src/v1/impls/parity_accounts.rs @@ -57,7 +57,7 @@ impl ParityAccounts for ParityAccountsClient where C: MiningBlock 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"); - 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![ "name".to_owned() => to_value(&v.name), "meta".to_owned() => to_value(&v.meta), From f7586109df8ed3cc1c20bd9774a2c4359ed1a903 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Wed, 7 Dec 2016 11:48:08 +0100 Subject: [PATCH 2/3] Ignore meta.deleted for accounts --- js/src/redux/providers/personalActions.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/js/src/redux/providers/personalActions.js b/js/src/redux/providers/personalActions.js index a1e9845db..7b51683b0 100644 --- a/js/src/redux/providers/personalActions.js +++ b/js/src/redux/providers/personalActions.js @@ -27,17 +27,18 @@ export function personalAccountsInfo (accountsInfo) { Object.keys(accountsInfo || {}) .map((address) => Object.assign({}, accountsInfo[address], { address })) - .filter((account) => !account.meta.deleted) .forEach((account) => { if (account.uuid) { accounts[account.address] = account; - } else if (account.meta.wallet) { - account.wallet = true; - wallets[account.address] = account; - } else if (account.meta.contract) { - contracts[account.address] = account; - } else { - contacts[account.address] = account; + } else if (!account.meta.deleted) { + if (account.meta.wallet) { + account.wallet = true; + wallets[account.address] = account; + } else if (account.meta.contract) { + contracts[account.address] = account; + } else { + contacts[account.address] = account; + } } }); From 5bdb6e4f22a9ab6d47b3a7dbcebccd1f4b0bac5b Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Wed, 7 Dec 2016 11:51:48 +0100 Subject: [PATCH 3/3] Ignore meta.deleted for account name display --- js/src/redux/providers/personalActions.js | 17 ++++++++--------- js/src/ui/IdentityName/identityName.js | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/js/src/redux/providers/personalActions.js b/js/src/redux/providers/personalActions.js index 7b51683b0..47056af2f 100644 --- a/js/src/redux/providers/personalActions.js +++ b/js/src/redux/providers/personalActions.js @@ -27,18 +27,17 @@ export function personalAccountsInfo (accountsInfo) { Object.keys(accountsInfo || {}) .map((address) => Object.assign({}, accountsInfo[address], { address })) + .filter((account) => account.uuid || !account.meta.deleted) .forEach((account) => { if (account.uuid) { accounts[account.address] = account; - } else if (!account.meta.deleted) { - if (account.meta.wallet) { - account.wallet = true; - wallets[account.address] = account; - } else if (account.meta.contract) { - contracts[account.address] = account; - } else { - contacts[account.address] = account; - } + } else if (account.meta.wallet) { + account.wallet = true; + wallets[account.address] = account; + } else if (account.meta.contract) { + contracts[account.address] = account; + } else { + contacts[account.address] = account; } }); diff --git a/js/src/ui/IdentityName/identityName.js b/js/src/ui/IdentityName/identityName.js index 85ff34a35..8f95ce116 100644 --- a/js/src/ui/IdentityName/identityName.js +++ b/js/src/ui/IdentityName/identityName.js @@ -37,7 +37,7 @@ class IdentityName extends Component { render () { const { address, accountsInfo, tokens, empty, name, shorten, unknown, className } = this.props; 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) { return null;