Return false from socket handlers to not dispatch action

This commit is contained in:
Ken-Håvard Lieng 2020-06-05 08:56:11 +02:00
parent a4fe18c0f0
commit a33157ff84
8 changed files with 141 additions and 126 deletions

View file

@ -26,7 +26,7 @@ export default class Socket {
this.ws.onopen = () => {
this.connected = true;
this.emit('_connected', true);
this.emit('connected', { connected: true });
clearTimeout(this.timeoutConnect);
this.backoff.reset();
this.setTimeoutPing();
@ -35,7 +35,7 @@ export default class Socket {
this.ws.onclose = () => {
if (this.connected) {
this.connected = false;
this.emit('_connected', false);
this.emit('connected', { connected: false });
}
clearTimeout(this.timeoutConnect);
clearTimeout(this.timeoutPing);