Skip to content

Commit

Permalink
break condition into a variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Abir Stolov committed Nov 26, 2024
1 parent 460aef8 commit bdc593f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/main/src/backend/export/outputVendors/ynab/ynab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ export function isSameTransaction(
transactionFromYnab: ynab.TransactionDetail,
) {
const isATransferTransaction = !!transactionFromYnab.transfer_account_id;
const isTransactionsImportIdEqual = isSameImportId(transactionToCreate, transactionFromYnab);
return (
transactionToCreate.account_id === transactionFromYnab.account_id &&
transactionToCreate.date === transactionFromYnab.date &&
Expand All @@ -205,7 +206,7 @@ export function isSameTransaction(
// In a transfer transaction the payee name changes, but we still consider this the same transaction
(areStringsEqualIgnoreCaseAndWhitespace(transactionToCreate.payee_name, transactionFromYnab.payee_name) ||
isATransferTransaction ||
isSameImportId(transactionToCreate, transactionFromYnab))
isTransactionsImportIdEqual)
);
}

Expand Down

0 comments on commit bdc593f

Please sign in to comment.