mirror of
https://github.com/coder/coder.git
synced 2026-10-29 17:44:33 +08:00
fix(site): do not return next page if the current size is lower than the limit (#10287)
This commit is contained in:
@@ -23,6 +23,9 @@ export const infiniteWorkspaceBuilds = (
|
|||||||
return {
|
return {
|
||||||
queryKey: ["workspaceBuilds", workspaceId, req],
|
queryKey: ["workspaceBuilds", workspaceId, req],
|
||||||
getNextPageParam: (lastPage, pages) => {
|
getNextPageParam: (lastPage, pages) => {
|
||||||
|
if (lastPage.length < limit) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
return pages.length + 1;
|
return pages.length + 1;
|
||||||
},
|
},
|
||||||
queryFn: ({ pageParam = 0 }) => {
|
queryFn: ({ pageParam = 0 }) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user