fix socket is null if PWA is offline
This commit is contained in:
parent
c0711879f7
commit
8488ce1402
1 changed files with 6 additions and 4 deletions
|
@ -139,10 +139,12 @@ class ServerConnection {
|
|||
|
||||
_disconnect() {
|
||||
this.send({ type: 'disconnect' });
|
||||
this._socket.onclose = null;
|
||||
this._socket.close();
|
||||
this._socket = null;
|
||||
Events.fire('ws-disconnected');
|
||||
if (this._socket) {
|
||||
this._socket.onclose = null;
|
||||
this._socket.close();
|
||||
this._socket = null;
|
||||
Events.fire('ws-disconnected');
|
||||
}
|
||||
}
|
||||
|
||||
_onDisconnect() {
|
||||
|
|
Loading…
Reference in a new issue