From 6c6cff1b0d02c2b0f0b2d9d17330dfc3c8ef0590 Mon Sep 17 00:00:00 2001 From: Gabriel Diaz Date: Thu, 5 Dec 2024 09:55:17 -0300 Subject: [PATCH] fix: Load random page --- src/components/ItemEditorPage/LeftPanel/LeftPanel.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ItemEditorPage/LeftPanel/LeftPanel.tsx b/src/components/ItemEditorPage/LeftPanel/LeftPanel.tsx index 10676ba02..30618bb40 100644 --- a/src/components/ItemEditorPage/LeftPanel/LeftPanel.tsx +++ b/src/components/ItemEditorPage/LeftPanel/LeftPanel.tsx @@ -153,7 +153,7 @@ export default class LeftPanel extends React.PureComponent { const { totalItems, totalCollections, onSetReviewedItems } = this.props const totalResources = this.isCollectionTabActive() ? totalCollections : totalItems const totalPages = Math.ceil(totalResources! / LEFT_PANEL_PAGE_SIZE) - if (pages.length !== totalPages) { + if (totalPages > 0 && pages.length !== totalPages) { let randomPage: number | undefined while (randomPage === undefined) { randomPage = this.getRandomPage(1, totalPages)