Skip to content

Commit

Permalink
make pagination reset to page 1 when position list is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
zielvna committed Jan 29, 2024
1 parent e4d6625 commit 0c2db99
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/containers/WrappedPositionsList/WrappedPositionsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ export const WrappedPositionsList: React.FC = () => {
}

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

Expand Down

0 comments on commit 0c2db99

Please sign in to comment.