We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9967e63 commit c0d7552Copy full SHA for c0d7552
examples/react/saas-large/src/db/products.ts
@@ -31,7 +31,7 @@ const itemsPerPage = 50
31
32
function computePageNumber(limit: number | undefined) {
33
const effectiveLimit = limit ?? itemsPerPage
34
- return Math.floor(effectiveLimit / itemsPerPage) - 1
+ return Math.max(0, Math.floor(effectiveLimit / itemsPerPage) - 1)
35
}
36
37
export const productsCollection = createCollection(
0 commit comments