refactor: streamline category data fetching in Content component by reducing logging and simplifying cache checks for improved readability
This commit is contained in:
@@ -96,6 +96,7 @@ const SharedCarousel = () => {
|
|||||||
rootCategories.length === 0 &&
|
rootCategories.length === 0 &&
|
||||||
typeof window !== "undefined"
|
typeof window !== "undefined"
|
||||||
) {
|
) {
|
||||||
|
console.log("SharedCarousel: Fetching categories by ignoring",window.productCache);
|
||||||
window.socketManager.emit("categoryList", { categoryId: 209, language: currentLanguage, requestTranslation: true }, (response) => {
|
window.socketManager.emit("categoryList", { categoryId: 209, language: currentLanguage, requestTranslation: true }, (response) => {
|
||||||
if (response && response.success) {
|
if (response && response.success) {
|
||||||
// Use translated data if available, otherwise fall back to original
|
// Use translated data if available, otherwise fall back to original
|
||||||
|
|||||||
@@ -229,6 +229,7 @@ class CategoryList extends Component {
|
|||||||
this.setState({ fetchedCategories: true });
|
this.setState({ fetchedCategories: true });
|
||||||
|
|
||||||
//console.log('CategoryList: Fetching categories from socket');
|
//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) => {
|
window.socketManager.emit("categoryList", { categoryId: 209, language: currentLanguage, requestTranslation: true }, (response) => {
|
||||||
if (response && response.success) {
|
if (response && response.success) {
|
||||||
// Use translated data if available, otherwise fall back to original
|
// Use translated data if available, otherwise fall back to original
|
||||||
|
|||||||
@@ -104,6 +104,7 @@ const Sitemap = () => {
|
|||||||
|
|
||||||
// Otherwise, fetch from socket if available (only in browser)
|
// Otherwise, fetch from socket if available (only in browser)
|
||||||
if (typeof window !== "undefined") {
|
if (typeof window !== "undefined") {
|
||||||
|
console.log("Sitemap: Fetching categories by ignoring",window.productCache);
|
||||||
window.socketManager.emit('categoryList', { categoryId: 209, language: 'en', requestTranslation: true }, (response) => {
|
window.socketManager.emit('categoryList', { categoryId: 209, language: 'en', requestTranslation: true }, (response) => {
|
||||||
if (response && response.categoryTree) {
|
if (response && response.categoryTree) {
|
||||||
// Store in cache
|
// Store in cache
|
||||||
|
|||||||
Reference in New Issue
Block a user