Skip to content

Commit

Permalink
fix _updatePeers calling two times for sender
Browse files Browse the repository at this point in the history
  • Loading branch information
bruncanepa committed Feb 3, 2024
1 parent 6714063 commit 1fca3c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/src/hooks/usePeer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export const usePeer = ({
host: "127.0.0.1",
port: 8081,
path: "/sockets",
debug: 3,
debug: 1,
secure: false,
});
addActivityLog({ type: "CREATE_SESSION_REQUESTED" });
Expand All @@ -156,8 +156,8 @@ export const usePeer = ({
})
.on("connection", (conn: DataConnection) => {
const peerId = conn.peer;
_updatePeers("add", peerId, conn);
if (peerIsSender) _listenToPeerEvents(peerId, conn);
else _updatePeers("add", peerId, conn);
})
.on("error", (err: PeerError<string>) => {
// TODO https://peerjs.com/docs/#peeron-error
Expand Down

0 comments on commit 1fca3c5

Please sign in to comment.