Skip to content

Commit ee6e3ba

Browse files
Simplify shouldClearConvertedAmount by removing duplicate currency comparison
Collapse the separate early-return and variable into a single return statement, eliminating the redundant transactionCurrency === destinationCurrency check. Co-authored-by: Aimane Chnaif <aimane-chnaif@users.noreply.github.com>
1 parent fe81f4e commit ee6e3ba

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

src/libs/TransactionUtils/index.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,13 +1049,7 @@ function shouldClearConvertedAmount(transaction: OnyxInputOrEntry<Transaction>,
10491049
const transactionCurrency = getCurrency(transaction);
10501050
const effectiveSourceCurrency = sourceCurrency ?? transactionCurrency;
10511051

1052-
if (effectiveSourceCurrency === destinationCurrency) {
1053-
return false;
1054-
}
1055-
1056-
const transactionMatchesDestination = transactionCurrency === destinationCurrency;
1057-
1058-
return !transactionMatchesDestination;
1052+
return effectiveSourceCurrency !== destinationCurrency && transactionCurrency !== destinationCurrency;
10591053
}
10601054

10611055
/**

0 commit comments

Comments
 (0)