Skip to content

Commit

Permalink
Merge pull request #516 from bitpay/revert-513-fix/contactName
Browse files Browse the repository at this point in the history
Revert "[FIX] get contact name function"
  • Loading branch information
JohnathanWhite authored Oct 28, 2022
2 parents 85efb68 + 66e697c commit 5fe7c8c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/navigation/wallet/components/MultipleOutputsTx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const MultipleOutputsTx = ({tx}: {tx: any}) => {
output.addressToShow =
addressToShow === 'false' ? t('Unparsed address') : addressToShow;

output.contactName = GetContactName(outputAddr, chain, contactList);
output.contactName = GetContactName(outputAddr, contactList);
});

const getDesc = () => {
Expand Down
9 changes: 3 additions & 6 deletions src/store/wallet/effects/transactions/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -546,15 +546,13 @@ export const EditTxNote = (wallet: Wallet, args: NoteArgs): Promise<any> => {

export const GetContactName = (
address: string | undefined,
chain: string,
contactList: any[] = [],
) => {
if (!address || !contactList.length) {
return null;
}
const existsContact = contactList.find(
contact =>
contact.address === address && contact.chain === chain.toLowerCase(),
contact => contact.address === address,
);
if (existsContact) {
return existsContact.name;
Expand Down Expand Up @@ -625,7 +623,6 @@ export const BuildUiFriendlyList = (
note,
message,
creatorName,
chain,
} = transaction || {};
const {
service: customDataService,
Expand All @@ -640,9 +637,9 @@ export const BuildUiFriendlyList = (
if (
contactList?.length &&
outputs?.length &&
GetContactName(outputs[0]?.address, chain, contactList)
GetContactName(outputs[0]?.address, contactList)
) {
contactName = GetContactName(outputs[0]?.address, chain, contactList);
contactName = GetContactName(outputs[0]?.address, contactList);
}

const isSent = IsSent(action);
Expand Down

0 comments on commit 5fe7c8c

Please sign in to comment.