fix socket is null if PWA is offline

This commit is contained in:
schlagmichdoch 2023-02-04 16:22:57 +01:00
parent c0711879f7
commit 8488ce1402

View file

@ -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() {