reconnect only after succesfull connection.

This commit is contained in:
Miroslav Šedivý 2021-06-19 20:21:32 +02:00
parent c49c9ad4de
commit 45c6c33647

View File

@ -123,8 +123,6 @@ export class NekoConnection extends EventEmitter<NekoConnectionEvents> {
} }
public async connect(video?: string): Promise<void> { public async connect(video?: string): Promise<void> {
this._shouldReconnect = true
await this._websocketConnect() await this._websocketConnect()
if (video && !this._state.webrtc.videos.includes(video)) { if (video && !this._state.webrtc.videos.includes(video)) {
@ -132,6 +130,8 @@ export class NekoConnection extends EventEmitter<NekoConnectionEvents> {
} }
this._webrtcConnect(video) this._webrtcConnect(video)
this._shouldReconnect = true
} }
public disconnect() { public disconnect() {