File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -495,13 +495,16 @@ export async function fetchAllConversations(project: string | null = null, maxCo
495
495
let offset = 0
496
496
while ( true ) {
497
497
try {
498
- const result = await fetchConversations ( offset , limit , project )
498
+ const result = project === null
499
+ ? await fetchConversations ( offset , limit )
500
+ : await fetchProjectConversations ( project , offset , limit )
499
501
if ( ! result . items ) {
500
502
// Handle potential API errors or empty responses
501
503
console . warn ( 'fetchAllConversations received no items at offset:' , offset )
502
504
break
503
505
}
504
506
conversations . push ( ...result . items )
507
+ if ( result . items . length === 0 ) break
505
508
// Stop if we've reached the total reported by the API OR the user-defined limit
506
509
if ( result . total !== null && offset + limit >= result . total ) break
507
510
if ( conversations . length >= maxConversations ) break
You can’t perform that action at this time.
0 commit comments