Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Reset infinite scroll if search's total pages is less than curre…
…nt state's total pages (#2610) ## What's the purpose of this pull request? This PR intends to fix the infinite scroll behavior when a search's total pages is different from the current state's total pages. Currently, if the current state's total pages are 3, for example, and a product search returns results with only 1 page the previous total pages will be considered, rendering skeletons and pages wrong. ![image](https://github.com/user-attachments/assets/d13e539d-8a7a-4f1f-ade0-3abb6566030e) ## How it works? It will reset the infinite scroll (always to the first page) if after a product search the total pages number is less than the previous total pages number. ## How to test it? Navigate to the `Office` PLP, load more than 2 pages then search for `apple` (in the search input). No skeletons or more than 1 page should be rendered. ### Starters Deploy Preview vtex-sites/starter.store#644 --------- Co-authored-by: Lucas Feijó <lucas.portela@vtex.com>
- Loading branch information