Skip to content

Commit

Permalink
Only set page prop back to 0 if it isn't already
Browse files Browse the repository at this point in the history
this way we prevent duplicated api calls.
  • Loading branch information
cpba committed Mar 25, 2023
1 parent 86a0a01 commit 646e7a3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/view/plugin/pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ export function Pagination() {
if (resetPageOnUpdate && updatedProcessor !== processor.current) {
setCurrentPage(0);

processor.current.setProps({
page: 0,
});
if (processor.current.props.page !== 0) {
processor.current.setProps({
page: 0,
});
}
}
};

Expand Down

0 comments on commit 646e7a3

Please sign in to comment.