From bdc593fbf1e2107d2f2339fa10870ac3e361a52f Mon Sep 17 00:00:00 2001 From: Abir Stolov Date: Tue, 26 Nov 2024 21:50:39 +0200 Subject: [PATCH] break condition into a variable --- packages/main/src/backend/export/outputVendors/ynab/ynab.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/main/src/backend/export/outputVendors/ynab/ynab.ts b/packages/main/src/backend/export/outputVendors/ynab/ynab.ts index 59b60c93..b555d5ce8d 100644 --- a/packages/main/src/backend/export/outputVendors/ynab/ynab.ts +++ b/packages/main/src/backend/export/outputVendors/ynab/ynab.ts @@ -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 && @@ -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) ); }