From eebbc4749bb0bd6434cf10da99cf4ca483924d23 Mon Sep 17 00:00:00 2001 From: Pedro Soares <32311264+pedromtec@users.noreply.github.com> Date: Fri, 3 Jan 2025 17:08:46 -0300 Subject: [PATCH] fix: revert the commit ccfbac80a8694b8e674c4657d51e3478ff2605bd (#2609) ## What's the purpose of this pull request? Revert this commit: https://github.com/vtex/faststore/commit/ccfbac80a8694b8e674c4657d51e3478ff2605bd --- .../templates/SearchPage/SearchWrapper.tsx | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/packages/core/src/components/templates/SearchPage/SearchWrapper.tsx b/packages/core/src/components/templates/SearchPage/SearchWrapper.tsx index 7371c11e1c..3f66a13f8a 100644 --- a/packages/core/src/components/templates/SearchPage/SearchWrapper.tsx +++ b/packages/core/src/components/templates/SearchPage/SearchWrapper.tsx @@ -38,8 +38,6 @@ export default function SearchWrapper({ const router = useRouter() const { state: { term, sort, selectedFacets }, - pages, - resetInfiniteScroll, } = useSearch() const { data: pageProductGalleryData, isValidating } = useProductGalleryQuery( @@ -64,16 +62,6 @@ export default function SearchWrapper({ return } - const totalPages = Math.ceil( - pageProductGalleryData.search.products.pageInfo.totalCount / itemsPerPage - ) - const stateTotalPages = pages.length - - // if the total pages is less than the current state total pages, reset the infinite scroll - if (totalPages > 0 && totalPages < stateTotalPages) { - resetInfiniteScroll(0) - } - return (