mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
reconnect: disconnect on destroy.
This commit is contained in:
parent
28f256b5b5
commit
b8453b3211
@ -165,6 +165,9 @@ export class NekoConnection extends EventEmitter<NekoConnectionEvents> {
|
||||
public destroy() {
|
||||
this._websocket_reconn.destroy()
|
||||
this._webrtc_reconn.destroy()
|
||||
|
||||
Vue.set(this._state, 'type', 'none')
|
||||
Vue.set(this._state, 'status', 'disconnected')
|
||||
}
|
||||
|
||||
_webrtcQualityDowngrade(quality: string): string | undefined {
|
||||
|
@ -173,10 +173,7 @@ export class Reconnector extends EventEmitter<ReconnectorEvents> {
|
||||
}
|
||||
|
||||
public destroy() {
|
||||
if (this._timeout) {
|
||||
window.clearTimeout(this._timeout)
|
||||
this._timeout = undefined
|
||||
}
|
||||
this.close()
|
||||
|
||||
this._conn.off('connect', this._onConnectHandle)
|
||||
this._conn.off('disconnect', this._onDisconnectHandle)
|
||||
|
@ -412,7 +412,6 @@
|
||||
|
||||
beforeDestroy() {
|
||||
this.observer.disconnect()
|
||||
this.connection.disconnect()
|
||||
this.connection.destroy()
|
||||
this.clear()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user