Skip to content

Commit

Permalink
Merge pull request #158 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 4e32574 + 6d1d836 commit b41d81d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/rpc/peers/rtc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,10 @@ class RTCPeers {
return;
}
console.log(`WebRTC: (8/12): ${from} Received ICE candidate`);
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);
if (typeof window !== "undefined") { // TODO: Figure out why this breaks on desktop
if (this.peerConnections[from].answered) this.peerConnections[from].answered.conn.addIceCandidate(iceCandidate).catch(console.error);
if (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 b41d81d

Please sign in to comment.