From 85a3f4fd9d9e87957a70feaddcac7c61ebdc1e7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Mon, 8 Feb 2021 18:46:07 +0100 Subject: [PATCH] minor WS &WebRTC fixes. --- src/component/internal/webrtc.ts | 7 +++---- src/component/main.vue | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/component/internal/webrtc.ts b/src/component/internal/webrtc.ts index 926faec0..4c71c34a 100644 --- a/src/component/internal/webrtc.ts +++ b/src/component/internal/webrtc.ts @@ -207,12 +207,10 @@ export class NekoWebRTC extends EventEmitter { 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 { if (this._statsStop && typeof this._statsStop === 'function') { this._statsStop() + this._statsStop = undefined } } diff --git a/src/component/main.vue b/src/component/main.vue index 3cdb4ec2..3d67112d 100644 --- a/src/component/main.vue +++ b/src/component/main.vue @@ -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 {