From 0974beaf4abf1a29cdf07942d0e59e4de8cd86c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Sat, 17 Jul 2021 15:30:37 +0200 Subject: [PATCH] webrtc: do not connect if websocket unavailable. --- src/component/internal/connection.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/component/internal/connection.ts b/src/component/internal/connection.ts index 7fbec204..fe722498 100644 --- a/src/component/internal/connection.ts +++ b/src/component/internal/connection.ts @@ -72,7 +72,9 @@ class WebrtcReconnecter extends ReconnecterAbstract { } public async connect() { - this._websocket.send(EVENT.SIGNAL_REQUEST, { video: this._state.webrtc.video }) + if (this._websocket.connected) { + this._websocket.send(EVENT.SIGNAL_REQUEST, { video: this._state.webrtc.video }) + } } public async disconnect() {