From 81ca2398d969ac5753d602c15d665851e49c5d95 Mon Sep 17 00:00:00 2001 From: "Parsa Yazdani (Quix)" Date: Wed, 6 Nov 2024 00:13:58 +1100 Subject: [PATCH] fix --- src/rpc/peers/rtc.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/rpc/peers/rtc.ts b/src/rpc/peers/rtc.ts index cd33289..dc3f158 100644 --- a/src/rpc/peers/rtc.ts +++ b/src/rpc/peers/rtc.ts @@ -246,10 +246,9 @@ class RTCPeers { return; } console.log(`WebRTC: (8/12): ${from} Received ICE candidate`); - if (this.peerConnections[from].offered && this.peerConnections[from].offered.conn.remoteDescription) this.peerConnections[from].offered.conn.addIceCandidate(iceCandidate).catch(console.error); - if (typeof window !== "undefined") { // TODO: If running in both desktop and browser, desktop crashes from port already in use error if (this.peerConnections[from].answered) this.peerConnections[from].answered.conn.addIceCandidate(iceCandidate).catch(console.error); - } + // TODO: Figure out why this breaks on desktop + if (typeof window !== "undefined" && this.peerConnections[from].offered && this.peerConnections[from].offered.conn.remoteDescription) this.peerConnections[from].offered.conn.addIceCandidate(iceCandidate).catch(console.error); } public fetch(input: RequestInfo, init?: RequestInit): Promise[] {