Skip to content

Commit 36a6c42

Browse files
authored
fix: check new transactions length (#1783)
1 parent ac6b84b commit 36a6c42

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/wallet/backend/src/transaction/service.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,18 +141,20 @@ export class TransactionService implements ITransactionService {
141141
page
142142
)
143143

144-
if (transactionsResponse.data.length === 0) {
145-
return
146-
}
147-
148144
const newTransactions = transactionsResponse.data.filter(
149145
(transaction) =>
150146
!latestTransaction ||
151147
latestTransaction.createdAt.toISOString() <= transaction.createdAt
152148
)
149+
150+
if (newTransactions.length === 0) {
151+
return
152+
}
153+
153154
if (transactionsResponse.data.length > newTransactions.length) {
154155
shouldFetchNext = false
155156
}
157+
156158
page++
157159

158160
const transactionsToSave: Partial<Transaction>[] = newTransactions.map(

0 commit comments

Comments
 (0)