Summary
Fixes the Home transaction list showing a converted line in a currency the transaction was not in, which read as a currency mismatch.
- Lark bug: https://hola-tech.sg.larksuite.com/record/BwmOreap7eSkWkcNDFXlCAv8gff
- Priority: Medium
- Module: Home / All Transactions
Root Cause
TransactionItem rendered the second line as convertAmount + ' ' + selectedCurrency.
-
convertTransactionAmountreturns a value for every fiat/crypto transaction, including one already denominated inselectedCurrency(identity conversion). - A 5 USDC withdrawal therefore showed
- 5.00 USDCabove and5.00 USDbelow — the same number under a different code — and a 2 USD card top-up repeated- 2.00 USD/2.00 USD. - Unlike the Assets list, the line had no
~prefix marking it as a conversion.
Changes
-
fe/src/lib/home/transaction-amount.utils.ts-
convertTransactionAmountnow returnsnullwhen the transaction's currency already equals the selected currency (both the crypto token branch and the fiat branch), so no redundant second line is rendered. - Comment updated to state both reasons the converted line is omitted.
-
-
fe/src/app/home/transaction.tsx- The remaining genuine conversions are rendered with the same
~prefix the Assets list uses (~ 11.10 EUR), so a number under a currency code is unambiguously an estimate in that currency.
- The remaining genuine conversions are rendered with the same
Behaviour after the fix
| Transaction | Before | After |
|---|---|---|
| Withdrawal 5 USDC (selected USD) |
- 5.00 USDC / 5.00 USD
|
- 5.00 USDC / ~ 5.00 USD
|
| Card Top Up 2 USD (selected USD) |
- 2.00 USD / 2.00 USD
|
- 2.00 USD |
| Transaction 12 USD (selected EUR) |
- 12.00 USD / 11.10 EUR
|
- 12.00 USD / ~ 11.10 EUR
|
Verification
-
fe/src/lib/home/transaction-amount.utils.test.ts-> 8 tests, added coverage for identity conversions (USD->USD, USDC->USDC, HKD->HKD) returningnull. -
fe/src/components/home/transaction-balance-mask.test.tsx-> updated assertion to the~prefix. - All Home-related suites:
9 suites / 47 testspassed. -
pnpm type-check: 0 errors. ESLint on modified files: 0 errors. - Conventional commitlint: passed.