minor WS &WebRTC fixes.

This commit is contained in:
Miroslav Šedivý 2021-02-08 18:46:07 +01:00
parent b6d61c0748
commit 85a3f4fd9d
2 changed files with 5 additions and 6 deletions

View File

@ -207,12 +207,10 @@ export class NekoWebRTC extends EventEmitter<NekoWebRTCEvents> {
break
default:
this._log.warn(`unknown data event: ${event}`)
return
}
// @ts-ignore
if (typeof buffer !== 'undefined') {
this._channel!.send(buffer)
}
this._channel!.send(buffer)
}
// not-implemented
@ -250,6 +248,7 @@ export class NekoWebRTC extends EventEmitter<NekoWebRTCEvents> {
if (this._statsStop && typeof this._statsStop === 'function') {
this._statsStop()
this._statsStop = undefined
}
}

View File

@ -203,7 +203,7 @@
throw new Error('client not connected to websocket')
}
this.websocket.disconnect()
this.websocket.disconnect(new Error('manual action'))
}
public webrtcConnect() {
@ -361,7 +361,7 @@
this.webrtc.disconnect()
this.clearState()
// reconnect WebRTC
// reconnect Websocket
if (this.authenticated) {
setTimeout(() => {
try {