From 5bdb6e4f22a9ab6d47b3a7dbcebccd1f4b0bac5b Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Wed, 7 Dec 2016 11:51:48 +0100 Subject: [PATCH] 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 7b51683b0d3..47056af2f6d 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 85ff34a3510..8f95ce11653 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;