We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0beb6be + d1a037b commit 5b33d89Copy full SHA for 5b33d89
client/src/MainApp/MatchmakerPage.jsx
@@ -99,10 +99,10 @@ class MatchmakerPage extends Component {
99
currentUserName: username
100
})
101
}
102
-
+
103
componentDidMount() {
104
this.socket = io.connect('http://localhost:3001');
105
106
var c = this;
107
this.socket.on("connect", () => {
108
console.log("Connected!");
@@ -144,14 +144,13 @@ class MatchmakerPage extends Component {
144
c.setState({ showChat: true });
145
146
147
- .on('disconnect', function () {
148
- this.socket.emit('disconnect');
149
- })
150
});
151
152
153
componentWillUnmount() {
154
+ if(this.socket){
+ this.socket.disconnect();
+ }
155
156
157
updateUserSeriousness(value) {
0 commit comments