From cfcd158d57d9ad1201023db372246e6e9a62c710 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 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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..6687a32c239 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 ?? '' + ? swapOrBridgeRecipient : txToAddress, accountInfosRegistry )