Skip to content

Commit

Permalink
Ensure there is an active page when calculating pages
Browse files Browse the repository at this point in the history
When (re-)calculating table page properties, it could happen that
no page gets marked as active. However, the application assumes
that there is always an active page. This fixes that.
  • Loading branch information
Arnei committed Nov 1, 2023
1 parent 390953b commit 544ef63
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/src/thunks/tableThunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -698,5 +698,9 @@ const calculatePages = (numberOfPages, offset) => {
});
}

if (pages.every(page => page.active === false)) {
pages[0].active = true;
}

return pages;
};

0 comments on commit 544ef63

Please sign in to comment.