mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Tidy getAccountsWithLabels selector (#8311)
This commit is contained in:
parent
d131014b5e
commit
be23ed5b2d
@ -238,18 +238,12 @@ export function accountsWithSendEtherInfoSelector (state) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getAccountsWithLabels (state) {
|
export function getAccountsWithLabels (state) {
|
||||||
const accountsWithoutLabel = accountsWithSendEtherInfoSelector(state)
|
return accountsWithSendEtherInfoSelector(state).map(({ address, name, balance }) => ({
|
||||||
const accountsWithLabels = accountsWithoutLabel.map((account) => {
|
address,
|
||||||
const { address, name, balance } = account
|
addressLabel: `${name} (...${address.slice(address.length - 4)})`,
|
||||||
return {
|
label: name,
|
||||||
address,
|
balance,
|
||||||
truncatedAddress: `${address.slice(0, 6)}...${address.slice(-4)}`,
|
}))
|
||||||
addressLabel: `${name} (...${address.slice(address.length - 4)})`,
|
|
||||||
label: name,
|
|
||||||
balance,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return accountsWithLabels
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getCurrentAccountWithSendEtherInfo (state) {
|
export function getCurrentAccountWithSendEtherInfo (state) {
|
||||||
|
Loading…
Reference in New Issue
Block a user