From 2782444d74d594158ea912b5965c83aaad3c8575 Mon Sep 17 00:00:00 2001 From: Yusef Habib Fernandez Date: Thu, 28 Nov 2024 17:06:19 +0100 Subject: [PATCH] adds comment --- frontend/src/lib/services/export-data.services.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/lib/services/export-data.services.ts b/frontend/src/lib/services/export-data.services.ts index 24aebe0187..6f49f32d7d 100644 --- a/frontend/src/lib/services/export-data.services.ts +++ b/frontend/src/lib/services/export-data.services.ts @@ -36,8 +36,12 @@ export const getAllTransactionsFromAccountAndIdentity = async ({ }); const updatedTransactions = [...allTransactions, ...transactions]; + + // We consider it complete if we find the oldestTxId in the list of transactions or if oldestTxId is null. + // The latter condition is necessary if the list of transactions is empty, which would otherwise return false. const completed = isNullish(oldestTxId) || transactions.some(({ id }) => id === oldestTxId); + if (!completed) { const lastTx = transactions[transactions.length - 1]; return getAllTransactionsFromAccountAndIdentity({