From 77ffe864b14747282ae024890aac505ea9685167 Mon Sep 17 00:00:00 2001 From: sebseb7 Date: Tue, 9 Sep 2025 11:39:44 +0200 Subject: [PATCH] feat(GrowTentKonfigurator): add category load status tracking Introduce categoryLoadStatus state to track loading for product categories. Replace forceUpdate with setState to properly update loading status on socket response. --- src/pages/GrowTentKonfigurator.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/pages/GrowTentKonfigurator.js b/src/pages/GrowTentKonfigurator.js index 2b71611..9c41c1f 100644 --- a/src/pages/GrowTentKonfigurator.js +++ b/src/pages/GrowTentKonfigurator.js @@ -76,7 +76,13 @@ class GrowTentKonfigurator extends Component { selectedLightType: savedState?.selectedLightType || 'led_quantum_board', selectedVentilationType: savedState?.selectedVentilationType || 'premium_ventilation', selectedExtras: savedState?.selectedExtras || [], - totalPrice: savedState?.totalPrice || 0 + totalPrice: savedState?.totalPrice || 0, + categoryLoadStatus: { + "Zelte": false, + "Lampen": false, + "Abluft-sets": false, + "Set-zubehoer": false + } }; this.handleTentShapeSelect = this.handleTentShapeSelect.bind(this); @@ -160,7 +166,12 @@ class GrowTentKonfigurator extends Component { window.socketManager.on(`productList:${categoryId}`,(response) => { setCachedCategoryData(categoryId, response); - this.forceUpdate(); + this.setState(prevState => ({ + categoryLoadStatus: { + ...prevState.categoryLoadStatus, + [categoryId]: true + } + })); }); const currentLanguage = this.props.languageContext?.currentLanguage || this.props.i18n?.language || 'de';