From 6268ac713214603debdb1defba3419f92815125a Mon Sep 17 00:00:00 2001 From: schlagmichdoch Date: Fri, 6 Jan 2023 15:46:51 +0100 Subject: [PATCH] only reopen connection if it exists --- public/scripts/network.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/public/scripts/network.js b/public/scripts/network.js index ec941dc..7637f4c 100644 --- a/public/scripts/network.js +++ b/public/scripts/network.js @@ -329,8 +329,7 @@ class RTCPeer extends Peer { _onChannelClosed() { console.log('RTC: channel closed', this._peerId); Events.fire('peer-disconnected', this._peerId); - if (!this._isCaller) return; - if (!this._conn) + if (!this._isCaller || !this._conn) return; this._connect(this._peerId, true); // reopen the channel }