From bd6d33fdedd738da330d56b620b62afb5b3dcc27 Mon Sep 17 00:00:00 2001 From: Douglas Daniel Date: Wed, 16 Oct 2024 10:24:21 -0500 Subject: [PATCH] fix(wallet): 0x Recipient Label on Transaction Confirmed Screen --- .../post-confirmation/common/transaction_intent.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/components/brave_wallet_ui/components/extension/post-confirmation/common/transaction_intent.tsx b/components/brave_wallet_ui/components/extension/post-confirmation/common/transaction_intent.tsx index ad892aa7d59..961f70108a1 100644 --- a/components/brave_wallet_ui/components/extension/post-confirmation/common/transaction_intent.tsx +++ b/components/brave_wallet_ui/components/extension/post-confirmation/common/transaction_intent.tsx @@ -126,11 +126,19 @@ export const TransactionIntent = (props: Props) => { const transactionConfirmed = transaction.txStatus === BraveWallet.TransactionStatus.Confirmed + // Currently we only get transaction.swapInfo.receiver info + // for lifi swaps. Core should also return this value + // for all other providers. + const swapOrBridgeRecipient = + transaction.swapInfo?.provider === 'lifi' + ? transaction.swapInfo?.receiver ?? '' + : transaction.fromAddress ?? '' + const recipientLabel = getAddressLabel( isERC20Approval ? txApprovalTarget - : isSwapOrBridge && transactionConfirmed - ? transaction.swapInfo?.receiver ?? '' + : isSwapOrBridge + ? swapOrBridgeRecipient : txToAddress, accountInfosRegistry )