Skip to content

Commit

Permalink
#403-category-id-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Margarita22 committed Jun 5, 2024
1 parent 59af645 commit 1f204a6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pages/ProductsPage/ProductsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export const ProductsPage = () => {

useEffect(() => {
dispatch(getProducts({ categoryId, filterProducts, filterQuantity, productsQuantityPerPage }))
}, [numberOfPage, categorySlug, filterProducts, filterQuantity])
}, [productsQuantityPerPage, categorySlug, filterProducts, filterQuantity, idOfCategory])

useEffect(() => {
if (window.location.search) {
Expand Down Expand Up @@ -129,15 +129,15 @@ export const ProductsPage = () => {
navigate(`${location.pathname}?${queryString}`)
}
isRender.current = true
}, [numberOfPage, categorySlug])
}, [numberOfPage, categorySlug, idOfCategory])

useEffect(() => {
if (!isMount.current) {
dispatch(setNumberOfPage(1))
setCurrentPage(1)
}
isMount.current = false
}, [categorySlug, filterProducts, filterQuantity])
}, [categorySlug, filterProducts, filterQuantity, selectQuantityFilter, selectProductsFilter])

return (
<>
Expand Down

0 comments on commit 1f204a6

Please sign in to comment.