From 45c6c33647d17c8d5bba6375b88dbb58a47d1b24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Sat, 19 Jun 2021 20:21:32 +0200 Subject: [PATCH] reconnect only after succesfull connection. --- src/component/internal/connection.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/component/internal/connection.ts b/src/component/internal/connection.ts index e90322a9..977e71c2 100644 --- a/src/component/internal/connection.ts +++ b/src/component/internal/connection.ts @@ -123,8 +123,6 @@ export class NekoConnection extends EventEmitter { } public async connect(video?: string): Promise { - this._shouldReconnect = true - await this._websocketConnect() if (video && !this._state.webrtc.videos.includes(video)) { @@ -132,6 +130,8 @@ export class NekoConnection extends EventEmitter { } this._webrtcConnect(video) + + this._shouldReconnect = true } public disconnect() {