refactor: replace socket prop usage with window.socketManager for consistent socket handling across components

This commit is contained in:
sebseb7
2025-07-23 08:08:58 +02:00
parent 9982527f35
commit 4e6b63a6a4
10 changed files with 56 additions and 145 deletions

View File

@@ -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,