Skip to content

Commit

Permalink
fix(wallet): Post Confirmation Transfer Value (uplift to 1.74.x) (#27045
Browse files Browse the repository at this point in the history
)

Uplift of #26939 (squashed) to beta
  • Loading branch information
brave-builds authored Dec 18, 2024
1 parent a001efe commit 0d92594
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ interface Props {
export const TransactionIntent = (props: Props) => {
const { transaction } = props

// Computed
// Computed & Queries
const isBridge = isBridgeTransaction(transaction)
const isSwap = isSwapTransaction(transaction)
const isSwapOrBridge = isBridge || isSwap
Expand All @@ -72,8 +72,13 @@ export const TransactionIntent = (props: Props) => {
const isSOLSwapOrBridge =
txCoinType === BraveWallet.CoinType.SOL && isSwapOrBridge

// Queries
const { account: txAccount } = useAccountQuery(transaction.fromAccountId)
const { data: combinedTokensList } = useGetCombinedTokensListQuery()

const transactionsToken = findTransactionToken(
transaction,
combinedTokensList
)

// Custom Hooks
const transactionNetwork = useTransactionsNetwork(transaction)
Expand All @@ -82,6 +87,7 @@ export const TransactionIntent = (props: Props) => {
const { normalizedTransferredValue } =
getFormattedTransactionTransferredValue({
tx: transaction,
token: transactionsToken,
txAccount,
txNetwork: transactionNetwork
})
Expand All @@ -108,8 +114,6 @@ export const TransactionIntent = (props: Props) => {
const { buyToken, sellToken, buyAmountWei, sellAmountWei } =
useSwapTransactionParser(transaction)

const { data: combinedTokensList } = useGetCombinedTokensListQuery()

const formattedSellAmount = sellToken
? sellAmountWei
.divideByDecimals(sellToken.decimals)
Expand Down Expand Up @@ -145,11 +149,6 @@ export const TransactionIntent = (props: Props) => {
accountInfosRegistry
)

const transactionsToken = findTransactionToken(
transaction,
combinedTokensList
)

const formattedSendAmount = React.useMemo(() => {
if (!transactionsToken) {
return ''
Expand Down

0 comments on commit 0d92594

Please sign in to comment.