Skip to content

Commit

Permalink
Merge pull request #15970 from brave/f/wallet/erc20-unlimited
Browse files Browse the repository at this point in the history
fix(wallet): fix ERC20 Approve amount for unlimited case
  • Loading branch information
onyb authored Nov 17, 2022
2 parents bca13fd + bfca82c commit 7be33a7
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ const TransactionDetailPanel = (props: Props) => {
liveTransaction.txType === BraveWallet.TransactionType.ERC721SafeTransferFrom) {
return transactionDetails.erc721BlockchainToken?.name + ' ' + transactionDetails.erc721TokenId
}

if (liveTransaction.txType === BraveWallet.TransactionType.ERC20Approve && transactionDetails.isApprovalUnlimited) {
return `${getLocale('braveWalletTransactionApproveUnlimited')} ${transactionDetails.symbol}`
}

return new Amount(transactionDetails.value)
.formatAsAsset(undefined, transactionDetails.symbol)
}, [transactionDetails, liveTransaction])
Expand Down

0 comments on commit 7be33a7

Please sign in to comment.