Skip to content

Commit

Permalink
Do not load more if error
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Trompette committed May 21, 2024
1 parent d9012d6 commit 90c3a14
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const useFindManyRecords = <T extends ObjectRecord = ObjectRecord>({

const fetchMoreRecords = useCallback(async () => {
// Remote objects does not support hasNextPage. We cannot rely on it to fetch more records.
if (hasNextPage || !isAggregationEnabled(objectMetadataItem)) {
if (hasNextPage || (!isAggregationEnabled(objectMetadataItem) && !error)) {
setIsFetchingMoreObjects(true);

try {
Expand Down

0 comments on commit 90c3a14

Please sign in to comment.