From 660e523263034e9d4b57b5a2bf1e8769d0c3612c Mon Sep 17 00:00:00 2001 From: schlagmichdoch Date: Mon, 6 Mar 2023 15:33:22 +0100 Subject: [PATCH] prevent sending of displayName if RTCPeer is not connected --- public/scripts/network.js | 5 +++++ public_included_ws_fallback/scripts/network.js | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/public/scripts/network.js b/public/scripts/network.js index d624812..0083814 100644 --- a/public/scripts/network.js +++ b/public/scripts/network.js @@ -694,6 +694,11 @@ class RTCPeer extends Peer { _isConnecting() { return this._channel && this._channel.readyState === 'connecting'; } + + sendDisplayName(displayName) { + if (!this._isConnected()) return; + super.sendDisplayName(displayName); + } } class PeersManager { diff --git a/public_included_ws_fallback/scripts/network.js b/public_included_ws_fallback/scripts/network.js index b745b93..c45f37a 100644 --- a/public_included_ws_fallback/scripts/network.js +++ b/public_included_ws_fallback/scripts/network.js @@ -705,6 +705,11 @@ class RTCPeer extends Peer { _isConnecting() { return this._channel && this._channel.readyState === 'connecting'; } + + sendDisplayName(displayName) { + if (!this._isConnected()) return; + super.sendDisplayName(displayName); + } } class WSPeer extends Peer {