Skip to content

Commit 4906add

Browse files
Add comment explaining sourceCurrency fallback in shouldClearConvertedAmount
Co-authored-by: Aimane Chnaif <aimane-chnaif@users.noreply.github.com>
1 parent ee6e3ba commit 4906add

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/libs/TransactionUtils/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,6 +1047,8 @@ function shouldClearConvertedAmount(transaction: OnyxInputOrEntry<Transaction>,
10471047
}
10481048

10491049
const transactionCurrency = getCurrency(transaction);
1050+
// sourceCurrency is undefined for unreported expenses (e.g. Self DM) since there's no source report.
1051+
// Fall back to the transaction's own currency so cross-currency detection still works.
10501052
const effectiveSourceCurrency = sourceCurrency ?? transactionCurrency;
10511053

10521054
return effectiveSourceCurrency !== destinationCurrency && transactionCurrency !== destinationCurrency;

0 commit comments

Comments
 (0)