Skip to content

Commit

Permalink
Merge pull request #855 from ambrosus/fix/transaction-negative-amount
Browse files Browse the repository at this point in the history
fix: solve issue with negative amount when it's zero
  • Loading branch information
ArturHoncharuk authored Dec 6, 2024
2 parents e4ee7de + 201dc51 commit 7bcbeac
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/templates/TransactionDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ export const TransactionDetails = ({
}, [transaction]);

const amountWithSymbolValue = useMemo(() => {
const amount = NumberUtils.numberToTransformedLocale(
transactionTokenInfo?.cryptoAmount ?? 0
);
const amount = NumberUtils.numberToTransformedLocale(transaction.amount);

return transaction.isSent ? `-${amount}` : amount;
}, [transaction, transactionTokenInfo]);
return transaction.isSent && transaction.amount !== 0
? `-${amount}`
: amount;
}, [transaction]);

return (
<View testID="Transaction_Details">
Expand Down

0 comments on commit 7bcbeac

Please sign in to comment.