Skip to content

Commit

Permalink
Merge pull request #157 from StarfilesFileSharing/alpha
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
QuixThe2nd authored Nov 5, 2024
2 parents 0c3082f + 81ca239 commit 4e32574
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 4e32574

Please sign in to comment.