Show warning when disconnected

This commit is contained in:
Ken-Håvard Lieng 2017-05-29 06:16:24 +02:00
parent 2d32df3afe
commit d9e3d71a1f
7 changed files with 88 additions and 32 deletions

View file

@ -26,12 +26,14 @@ export default class Socket {
}, this.connectTimeout);
this.ws.onopen = () => {
this.emit('_connected', true);
clearTimeout(this.timeoutConnect);
this.backoff.reset();
this.setTimeoutPing();
};
this.ws.onclose = () => {
this.emit('_connected', false);
clearTimeout(this.timeoutConnect);
clearTimeout(this.timeoutPing);
if (!this.closing) {