diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-05-15 16:36:58 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-05-15 16:36:58 +0200 |
| commit | 235fe67d770f83131c9ec10b99012319440db690 (patch) | |
| tree | 3b96e2c8a5877fe15a9cfa6bff46130fa7a04a65 /src/utils/hooks/use-pagination.tsx | |
| parent | fe2252ced2bb895e26179640553b5a6c02957d54 (diff) | |
chore: add Search page
Diffstat (limited to 'src/utils/hooks/use-pagination.tsx')
| -rw-r--r-- | src/utils/hooks/use-pagination.tsx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/utils/hooks/use-pagination.tsx b/src/utils/hooks/use-pagination.tsx index 1e24b75..a80a539 100644 --- a/src/utils/hooks/use-pagination.tsx +++ b/src/utils/hooks/use-pagination.tsx @@ -99,7 +99,8 @@ const usePagination = <T extends object>({ isLoadingInitialData || (size > 0 && data && typeof data[size - 1] === 'undefined'); const isRefreshing = isValidating && data && data.length === size; - const hasNextPage = data && data[data.length - 1].pageInfo.hasNextPage; + const hasNextPage = + data && data.length > 0 && data[data.length - 1].pageInfo.hasNextPage; return { data, |
