From be23ed5b2d90dbeef771a883dcf2e217f9d1b8a3 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Wed, 8 Apr 2020 20:45:36 -0230 Subject: [PATCH] Tidy getAccountsWithLabels selector (#8311) --- ui/app/selectors/selectors.js | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/ui/app/selectors/selectors.js b/ui/app/selectors/selectors.js index 11587a28f..f74266892 100644 --- a/ui/app/selectors/selectors.js +++ b/ui/app/selectors/selectors.js @@ -238,18 +238,12 @@ export function accountsWithSendEtherInfoSelector (state) { } export function getAccountsWithLabels (state) { - const accountsWithoutLabel = accountsWithSendEtherInfoSelector(state) - const accountsWithLabels = accountsWithoutLabel.map((account) => { - const { address, name, balance } = account - return { - address, - truncatedAddress: `${address.slice(0, 6)}...${address.slice(-4)}`, - addressLabel: `${name} (...${address.slice(address.length - 4)})`, - label: name, - balance, - } - }) - return accountsWithLabels + return accountsWithSendEtherInfoSelector(state).map(({ address, name, balance }) => ({ + address, + addressLabel: `${name} (...${address.slice(address.length - 4)})`, + label: name, + balance, + })) } export function getCurrentAccountWithSendEtherInfo (state) {