From 934f6abc92b97c386962e1c8a565546a006425bb Mon Sep 17 00:00:00 2001 From: sebseb7 Date: Wed, 23 Jul 2025 10:29:21 +0200 Subject: [PATCH] refactor: remove socket.io method overrides in Content component to streamline category data fetching and improve code clarity --- src/components/Content.js | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/src/components/Content.js b/src/components/Content.js index 3f2e6f5..1a45daa 100644 --- a/src/components/Content.js +++ b/src/components/Content.js @@ -229,39 +229,6 @@ class Content extends Component { } } - // CRITICAL: Override socket.io methods if we have the cache - if (window.productCache && - window.productCache["categoryTree_209"] && - window.productCache["categoryTree_209"].categoryTree) { - console.log("🚫 OVERRIDING SOCKET.IO METHODS - Cache exists"); - - // Create backup of original methods - if (!window._originalSocketEmit && window.socketManager) { - window._originalSocketEmit = window.socketManager.emit; - - // Override emit method to prevent categoryList calls - window.socketManager.emit = (event, data, callback) => { - if (event === "getCategoryProducts") { - console.log("🚫 BLOCKED getCategoryProducts socket call"); - if (callback) { - // Return empty response to satisfy callback - setTimeout(() => { - callback({ - products: [], - attributes: [], - categoryName: "Cached Category" - }); - }, 0); - } - return; - } - - // Pass through other events - return window._originalSocketEmit.call(window.socketManager, event, data, callback); - }; - } - } - if(this.props.params.categoryId) {this.setState({loaded: false, unfilteredProducts: [], filteredProducts: [], attributes: [], categoryName: null, childCategories: []}, () => { this.fetchCategoryData(this.props.params.categoryId); })}