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 {