prevent sending of displayName if RTCPeer is not connected

This commit is contained in:
schlagmichdoch 2023-03-06 15:33:22 +01:00
parent cdfbc7a2df
commit 660e523263
2 changed files with 10 additions and 0 deletions

View file

@ -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 {

View file

@ -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 {