Skip to content

Commit feae3d8

Browse files
committed
fix logic
1 parent 414099d commit feae3d8

1 file changed

Lines changed: 9 additions & 13 deletions

File tree

frontend/src/components/ShopContent/ShopContent.jsx

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// ShopContent Component - Main shop page with filtering and pagination
21
import { useState, useEffect } from "react";
32
import { useParams, useNavigate } from "react-router-dom";
43
import "./ShopContent.scss";
@@ -298,18 +297,6 @@ const ShopContent = () => {
298297
return matchesCategory && matchesPrice && matchesBrand && matchesSearch;
299298
});
300299

301-
console.log("ShopContent - Debug:", {
302-
totalProducts: products.length,
303-
filteredCount: filteredProducts.length,
304-
currentProductsCount: filteredProducts.slice(
305-
indexOfFirstProduct,
306-
indexOfLastProduct,
307-
).length,
308-
selectedMainCategory,
309-
isLoadingProducts,
310-
config: config.useMockData,
311-
});
312-
313300
const totalProducts = filteredProducts.length;
314301
const totalPages = Math.ceil(totalProducts / productsPerPage);
315302
const indexOfLastProduct = currentPage * productsPerPage;
@@ -319,6 +306,15 @@ const ShopContent = () => {
319306
indexOfLastProduct,
320307
);
321308

309+
console.log("ShopContent - Debug:", {
310+
totalProducts: products.length,
311+
filteredCount: filteredProducts.length,
312+
currentProductsCount: currentProducts.length,
313+
selectedMainCategory,
314+
isLoadingProducts,
315+
config: config.useMockData,
316+
});
317+
322318
const getCategoryIcon = (categoryName) => {
323319
const name = categoryName.toLowerCase();
324320

0 commit comments

Comments
 (0)