Skip to content

Commit

Permalink
fix: revert the commit ccfbac8 (#2609)
Browse files Browse the repository at this point in the history
## What's the purpose of this pull request?

Revert this commit:
ccfbac8
  • Loading branch information
pedromtec authored Jan 3, 2025
1 parent ccfbac8 commit 49679ae
Showing 1 changed file with 0 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ export default function SearchWrapper({
const router = useRouter()
const {
state: { term, sort, selectedFacets },
pages,
resetInfiniteScroll,
} = useSearch()

const { data: pageProductGalleryData, isValidating } = useProductGalleryQuery(
Expand All @@ -64,16 +62,6 @@ export default function SearchWrapper({
return <EmptySearch />
}

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 (
<SearchPage
page={searchContentType}
Expand Down

0 comments on commit 49679ae

Please sign in to comment.