refactor: standardize socket communication by replacing socket prop usage with window.socketManager across multiple components for improved consistency and maintainability
This commit is contained in:
@@ -143,19 +143,15 @@ class GrowTentKonfigurator extends Component {
|
||||
return;
|
||||
}
|
||||
|
||||
//if (!this.props.socket || !this.props.socket.connected) {
|
||||
// console.log("Socket not connected yet, waiting for connection to fetch category data");
|
||||
// return;
|
||||
//}
|
||||
console.log(`productList:${categoryId}`);
|
||||
this.props.socket.off(`productList:${categoryId}`);
|
||||
window.socketManager.off(`productList:${categoryId}`);
|
||||
|
||||
this.props.socket.on(`productList:${categoryId}`,(response) => {
|
||||
window.socketManager.on(`productList:${categoryId}`,(response) => {
|
||||
console.log("getCategoryProducts full response", response);
|
||||
setCachedCategoryData(categoryId, response);
|
||||
});
|
||||
|
||||
this.props.socket.emit("getCategoryProducts", { categoryId: categoryId },
|
||||
window.socketManager.emit("getCategoryProducts", { categoryId: categoryId },
|
||||
(response) => {
|
||||
console.log("getCategoryProducts stub response", response);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user