Fix "hasNextPage" calculation for Library grid (#366)
"totalPages" could have decimal places which then would lead to incorrectly disabling the "hasNextPage" flag
This commit is contained in:
@@ -120,7 +120,7 @@ const LibraryMangaGrid: React.FC<LibraryMangaGridProps & { lastLibraryUpdate: nu
|
|||||||
const [query] = useQueryParam('query', StringParam);
|
const [query] = useQueryParam('query', StringParam);
|
||||||
const { options } = useLibraryOptionsContext();
|
const { options } = useLibraryOptionsContext();
|
||||||
const { unread, downloaded } = options;
|
const { unread, downloaded } = options;
|
||||||
const totalPages = (mangas ?? []).length / 10;
|
const totalPages = Math.trunc((mangas ?? []).length / 10);
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const isLargeScreen = useMediaQuery(theme.breakpoints.up('sm'), { noSsr: true });
|
const isLargeScreen = useMediaQuery(theme.breakpoints.up('sm'), { noSsr: true });
|
||||||
const defaultPageNumber = isLargeScreen ? 4 : 1;
|
const defaultPageNumber = isLargeScreen ? 4 : 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user