Skip to content

Commit

Permalink
fix: Load random page
Browse files Browse the repository at this point in the history
  • Loading branch information
cyaiox committed Dec 5, 2024
1 parent 71aa6c3 commit 6c6cff1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/ItemEditorPage/LeftPanel/LeftPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export default class LeftPanel extends React.PureComponent<Props, State> {
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)
Expand Down

0 comments on commit 6c6cff1

Please sign in to comment.