Lower max attempts in userAutoPagination
This commit is contained in:
@@ -9,6 +9,8 @@ import {
|
|||||||
import {app} from '#/lexicons'
|
import {app} from '#/lexicons'
|
||||||
import * as bsky from '#/types/bsky'
|
import * as bsky from '#/types/bsky'
|
||||||
|
|
||||||
|
const MAX_ATTEMPTS = 5
|
||||||
|
|
||||||
type AutoPaginationQuery = {
|
type AutoPaginationQuery = {
|
||||||
data?: {pageParams: unknown[]}
|
data?: {pageParams: unknown[]}
|
||||||
isLoading: boolean
|
isLoading: boolean
|
||||||
@@ -75,7 +77,7 @@ export function useAutoPagination(
|
|||||||
.some(param => Object.is(cursorOf(param), currentCursor))
|
.some(param => Object.is(cursorOf(param), currentCursor))
|
||||||
if (repeatedCursor) return
|
if (repeatedCursor) return
|
||||||
attemptCount.current++
|
attemptCount.current++
|
||||||
if (attemptCount.current < 50) {
|
if (attemptCount.current < MAX_ATTEMPTS) {
|
||||||
void query.fetchNextPage()
|
void query.fetchNextPage()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user