From 15e369da33c02e4def30e14aea0dbc5fcc189f50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Mon, 8 Feb 2021 22:32:33 +0100 Subject: [PATCH] webrtc force close all. --- src/component/internal/webrtc.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/component/internal/webrtc.ts b/src/component/internal/webrtc.ts index 4c71c34a..bfd0a51c 100644 --- a/src/component/internal/webrtc.ts +++ b/src/component/internal/webrtc.ts @@ -150,15 +150,12 @@ export class NekoWebRTC extends EventEmitter { } public disconnect() { - if (this.connected) { - try { - this._peer!.close() - } catch (err) {} - - this._peer = undefined - this._channel = undefined - } + try { + this._peer!.close() + } catch (err) {} + this._peer = undefined + this._channel = undefined this._state = 'disconnected' }