From a2b7a2509f4fccccca4ff47cae51b55a96447750 Mon Sep 17 00:00:00 2001 From: sebseb7 Date: Wed, 23 Jul 2025 10:08:23 +0200 Subject: [PATCH] refactor: streamline category data fetching in Content component by reducing logging and simplifying cache checks for improved readability --- src/components/SharedCarousel.js | 1 + src/components/header/CategoryList.js | 1 + src/pages/Sitemap.js | 1 + 3 files changed, 3 insertions(+) diff --git a/src/components/SharedCarousel.js b/src/components/SharedCarousel.js index c2b6361..d2592c8 100644 --- a/src/components/SharedCarousel.js +++ b/src/components/SharedCarousel.js @@ -96,6 +96,7 @@ const SharedCarousel = () => { rootCategories.length === 0 && typeof window !== "undefined" ) { + console.log("SharedCarousel: Fetching categories by ignoring",window.productCache); window.socketManager.emit("categoryList", { categoryId: 209, language: currentLanguage, requestTranslation: true }, (response) => { if (response && response.success) { // Use translated data if available, otherwise fall back to original diff --git a/src/components/header/CategoryList.js b/src/components/header/CategoryList.js index ab96070..f79c874 100644 --- a/src/components/header/CategoryList.js +++ b/src/components/header/CategoryList.js @@ -229,6 +229,7 @@ class CategoryList extends Component { this.setState({ fetchedCategories: true }); //console.log('CategoryList: Fetching categories from socket'); + console.log("CategoryList: Fetching categories by ignoring",window.productCache); window.socketManager.emit("categoryList", { categoryId: 209, language: currentLanguage, requestTranslation: true }, (response) => { if (response && response.success) { // Use translated data if available, otherwise fall back to original diff --git a/src/pages/Sitemap.js b/src/pages/Sitemap.js index 613db7a..0addc58 100644 --- a/src/pages/Sitemap.js +++ b/src/pages/Sitemap.js @@ -104,6 +104,7 @@ const Sitemap = () => { // Otherwise, fetch from socket if available (only in browser) if (typeof window !== "undefined") { + console.log("Sitemap: Fetching categories by ignoring",window.productCache); window.socketManager.emit('categoryList', { categoryId: 209, language: 'en', requestTranslation: true }, (response) => { if (response && response.categoryTree) { // Store in cache