fix selector

This commit is contained in:
Mikhail Mikheev 2020-04-23 18:16:10 +04:00
parent 0e9b6d2cc1
commit cff53e76c9
1 changed files with 1 additions and 4 deletions

View File

@ -39,14 +39,11 @@ export const getNameFromAddressBook = createSelector(
getAddressBookListSelector,
(_, address) => address,
(addressBook: Map<string, AddressBook>, address: string) => {
if (!address) {
return 'UNKNOWN'
}
const adbkEntry = addressBook.find((addressBookItem) => addressBookItem.address === address)
if (adbkEntry) {
return adbkEntry.name
}
return 'UNKNOWN'
},
)