File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -34,12 +34,12 @@ export const PaginationWidget = ({
34
34
const currentPage = paginationState . context . page
35
35
const numRecordsPerPage = paginationState . context . limit
36
36
37
- const numPages = numRecords ? Math . ceil ( numRecords / numRecordsPerPage ) : 0
37
+ const numPages = numRecords ? Math . ceil ( numRecords / numRecordsPerPage ) : undefined
38
38
const firstPageActive = currentPage === 1 && numPages !== 0
39
39
const lastPageActive = currentPage === numPages && numPages !== 0
40
40
41
41
// No need to display any pagination if we know the number of pages is 1 or 0
42
- if ( numPages <= 1 || numRecords === 0 ) {
42
+ if ( numPages && numPages <= 1 || numRecords === 0 ) {
43
43
return null
44
44
}
45
45
@@ -54,7 +54,7 @@ export const PaginationWidget = ({
54
54
< KeyboardArrowLeft />
55
55
< div > { prevLabel } </ div >
56
56
</ Button >
57
- < Maybe condition = { numPages > 0 } >
57
+ < Maybe condition = { numPages !== undefined } >
58
58
< ChooseOne >
59
59
< Cond condition = { isMobile } >
60
60
< PageButton
@@ -64,7 +64,7 @@ export const PaginationWidget = ({
64
64
/>
65
65
</ Cond >
66
66
< Cond >
67
- { buildPagedList ( numPages , currentPage ) . map ( ( page ) =>
67
+ { numPages && buildPagedList ( numPages , currentPage ) . map ( ( page ) =>
68
68
typeof page !== "number" ? (
69
69
< PageButton
70
70
key = { `Page${ page } ` }
You can’t perform that action at this time.
0 commit comments