Skip to content

Commit

Permalink
fix pagination when removing position
Browse files Browse the repository at this point in the history
  • Loading branch information
zielvna committed Jan 30, 2024
1 parent 0c2db99 commit 2aa1b95
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/containers/WrappedPositionsList/WrappedPositionsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ export const WrappedPositionsList: React.FC = () => {
if (list.length === 0) {
setLastPage(1)
}

if (lastPage > Math.ceil(list.length / 5)) {
setLastPage(lastPage - 1)
}
}, [list])

return (
Expand Down

0 comments on commit 2aa1b95

Please sign in to comment.