Show warning when disconnected
This commit is contained in:
parent
2d32df3afe
commit
d9e3d71a1f
7 changed files with 88 additions and 32 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue