mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 03:52:50 +08:00
fix: validate screen share connection state
This commit is contained in:
1 parent
ae530963bf
commit
fb39d82c01
1 file changed
+5
-1
@@ -1715,7 +1715,11 @@ export function useVoiceWebSocket() {
|
||||
screenShareViewing.value = true;
|
||||
};
|
||||
peer.onconnectionstatechange = () => {
|
||||
if (peer.connectionState === "connected" || peer.connectionState === "completed") {
|
||||
// `completed` belongs to RTCIceConnectionState, not the aggregate
|
||||
// RTCPeerConnection.connectionState. Treating it as a connection state
|
||||
// both trips the type checker and can hide the actual failed/closed
|
||||
// transitions we need to handle here.
|
||||
if (peer.connectionState === "connected") {
|
||||
clearScreenSharePeerTimer(peerId);
|
||||
} else if (peer.connectionState === "failed") {
|
||||
failScreenSharePeer(peerId);
|
||||
|
||||
Reference in new issue
Block a user