Skip to content

Commit

Permalink
fix: use valid cursor when fetching transactions (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahin-hq authored Feb 6, 2025
1 parent 2a52331 commit 3da9184
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/profiles/source/transaction.aggregate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ export class TransactionAggregate implements ITransactionAggregate {

const historyKey = historyKeys.join("-");

if (historyRecords[historyKey]) {
query = { ...query, cursor: historyRecords[historyKey].nextPage() };
const historyRecord = historyRecords[historyKey];

if (historyRecord && historyRecord.nextPage()) {
query = { ...query, cursor: historyRecord.nextPage() };
}

let response: ExtendedConfirmedTransactionDataCollection;
Expand Down

0 comments on commit 3da9184

Please sign in to comment.