From 621a06f7ba719bba516d5c0354f5a62ac5fa381e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Tue, 10 Aug 2021 20:19:55 +0200 Subject: [PATCH] do not attempt connection if not supported. --- src/component/internal/reconnector/webrtc.ts | 2 ++ src/component/internal/reconnector/websocket.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/component/internal/reconnector/webrtc.ts b/src/component/internal/reconnector/webrtc.ts index ec1688cf..12ad444b 100644 --- a/src/component/internal/reconnector/webrtc.ts +++ b/src/component/internal/reconnector/webrtc.ts @@ -33,6 +33,8 @@ export class WebrtcReconnector extends ReconnectorAbstract { } public connect() { + if (!this._webrtc.supported) return + if (this._webrtc.connected) { this._webrtc.disconnect() } diff --git a/src/component/internal/reconnector/websocket.ts b/src/component/internal/reconnector/websocket.ts index 0b4da406..378d2898 100644 --- a/src/component/internal/reconnector/websocket.ts +++ b/src/component/internal/reconnector/websocket.ts @@ -29,6 +29,8 @@ export class WebsocketReconnector extends ReconnectorAbstract { } public connect() { + if (!this._websocket.supported) return + if (this._websocket.connected) { this._websocket.disconnect() }