refactor: replace socket prop usage with window.socketManager for consistent socket handling across components
This commit is contained in:
@@ -85,11 +85,10 @@ class ArticleRatingForm extends Component {
|
||||
// Emit data via socket
|
||||
console.log('Article Rating Data to emit:', ratingData);
|
||||
|
||||
if (this.props.socket) {
|
||||
this.props.socket.emit('article_rating_submit', ratingData);
|
||||
window.socketManager.emit('article_rating_submit', ratingData);
|
||||
|
||||
// Set up response handler
|
||||
this.props.socket.once('article_rating_response', (response) => {
|
||||
window.socketManager.once('article_rating_response', (response) => {
|
||||
if (response.success) {
|
||||
this.setState({
|
||||
loading: false,
|
||||
@@ -116,7 +115,6 @@ class ArticleRatingForm extends Component {
|
||||
this.setState({ success: false, error: null });
|
||||
}, 3000);
|
||||
});
|
||||
}
|
||||
} catch {
|
||||
this.setState({
|
||||
loading: false,
|
||||
|
||||
Reference in New Issue
Block a user