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

@@ -77,11 +77,11 @@ class ArticleQuestionForm extends Component {
// Emit data via socket
console.log('Article Question Data to emit:', questionData);
if (this.props.socket) {
this.props.socket.emit('article_question_submit', questionData);
window.socketManager.emit('article_question_submit', questionData);
// Set up response handler
this.props.socket.once('article_question_response', (response) => {
window.socketManager.once('article_question_response', (response) => {
if (response.success) {
this.setState({
loading: false,
@@ -107,7 +107,6 @@ class ArticleQuestionForm extends Component {
this.setState({ success: false, error: null });
}, 3000);
});
}
} catch {
this.setState({
loading: false,