mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-21 07:16:18 -04:00
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() {
|
_disconnect() {
|
||||||
this.send({ type: 'disconnect' });
|
this.send({ type: 'disconnect' });
|
||||||
this._socket.onclose = null;
|
if (this._socket) {
|
||||||
this._socket.close();
|
this._socket.onclose = null;
|
||||||
this._socket = null;
|
this._socket.close();
|
||||||
Events.fire('ws-disconnected');
|
this._socket = null;
|
||||||
|
Events.fire('ws-disconnected');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_onDisconnect() {
|
_onDisconnect() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue