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.
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user