Don't block new PC if connection is stable. No need to

This commit is contained in:
Adam Shiervani 2025-04-09 23:22:33 +02:00
parent bf89e038ee
commit 8868a8ef32
1 changed files with 1 additions and 7 deletions

View File

@ -243,7 +243,7 @@ export default function KvmIdRoute() {
{ {
heartbeat: true, heartbeat: true,
retryOnError: true, retryOnError: true,
reconnectAttempts: 5, reconnectAttempts: 15,
reconnectInterval: 1000, reconnectInterval: 1000,
onReconnectStop: () => { onReconnectStop: () => {
console.log("Reconnect stopped"); console.log("Reconnect stopped");
@ -398,11 +398,6 @@ export default function KvmIdRoute() {
setConnectionFailed(false); setConnectionFailed(false);
setLoadingMessage("Connecting to device..."); setLoadingMessage("Connecting to device...");
if (peerConnection?.signalingState === "stable") {
console.log("[setupPeerConnection] Peer connection already established");
return;
}
let pc: RTCPeerConnection; let pc: RTCPeerConnection;
try { try {
console.log("[setupPeerConnection] Creating peer connection"); console.log("[setupPeerConnection] Creating peer connection");
@ -499,7 +494,6 @@ export default function KvmIdRoute() {
cleanupAndStopReconnecting, cleanupAndStopReconnecting,
iceConfig?.iceServers, iceConfig?.iceServers,
legacyHTTPSignaling, legacyHTTPSignaling,
peerConnection?.signalingState,
sendWebRTCSignal, sendWebRTCSignal,
setDiskChannel, setDiskChannel,
setMediaMediaStream, setMediaMediaStream,