set as disconnected only if not connecting.

This commit is contained in:
Miroslav Šedivý 2021-06-19 21:42:25 +02:00
parent 5c8c8c1330
commit f6edb4208e

View File

@ -44,7 +44,7 @@ export class NekoConnection extends EventEmitter<NekoConnectionEvents> {
} }
}) })
this.websocket.on('disconnected', () => { this.websocket.on('disconnected', () => {
if (this._state.status !== 'disconnected') { if (this._state.status === 'connected') {
Vue.set(this._state, 'status', 'disconnected') Vue.set(this._state, 'status', 'disconnected')
} }
@ -63,7 +63,7 @@ export class NekoConnection extends EventEmitter<NekoConnectionEvents> {
} }
}) })
this.webrtc.on('disconnected', () => { this.webrtc.on('disconnected', () => {
if (this._state.status !== 'disconnected') { if (this._state.status === 'connected') {
Vue.set(this._state, 'status', 'disconnected') Vue.set(this._state, 'status', 'disconnected')
} }