Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
QuixThe2nd committed Nov 5, 2024
1 parent 16d7777 commit 81ca239
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/rpc/peers/rtc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Response>[] {
Expand Down

0 comments on commit 81ca239

Please sign in to comment.