disconnect on navigator.connection.change
This commit is contained in:
parent
516e1ddf59
commit
7deeba161b
1 changed files with 3 additions and 0 deletions
|
@ -8,6 +8,9 @@ class ServerConnection {
|
||||||
Events.on('beforeunload', _ => this._disconnect());
|
Events.on('beforeunload', _ => this._disconnect());
|
||||||
Events.on('pagehide', _ => this._disconnect());
|
Events.on('pagehide', _ => this._disconnect());
|
||||||
document.addEventListener('visibilitychange', _ => this._onVisibilityChange());
|
document.addEventListener('visibilitychange', _ => this._onVisibilityChange());
|
||||||
|
if (navigator.connection) {
|
||||||
|
navigator.connection.addEventListener('change', _ => this._disconnect());
|
||||||
|
}
|
||||||
Events.on('reconnect', _ => this._reconnect());
|
Events.on('reconnect', _ => this._reconnect());
|
||||||
Events.on('room-secrets', e => this._sendRoomSecrets(e.detail));
|
Events.on('room-secrets', e => this._sendRoomSecrets(e.detail));
|
||||||
Events.on('room-secret-deleted', e => this.send({ type: 'room-secret-deleted', roomSecret: e.detail}));
|
Events.on('room-secret-deleted', e => this.send({ type: 'room-secret-deleted', roomSecret: e.detail}));
|
||||||
|
|
Loading…
Reference in a new issue