Skip to content

Commit 250ee17

Browse files
authored
fix: Page offset on workspace pagination was incorrect (#6693)
* fix: Page offset on workspace pagination was incorrect
1 parent 1ccbd54 commit 250ee17

File tree

1 file changed

+3
-1
lines changed
  • site/src/pages/WorkspacesPage

1 file changed

+3
-1
lines changed

site/src/pages/WorkspacesPage/data.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ export const useWorkspacesData = ({
3232
getWorkspaces({
3333
q: query,
3434
limit: limit,
35-
offset: page,
35+
// If the page is <= 0, just use offset 0. This usually happens
36+
// if the page is not provided.
37+
offset: page <= 0 ? 0 : (page - 1) * limit,
3638
}),
3739
refetchInterval: 5_000,
3840
})

0 commit comments

Comments
 (0)