From 1fca3c53ed85e34e06fa448929ab2a1780f416c4 Mon Sep 17 00:00:00 2001 From: Bruno Canepa <8711973+bruncanepa@users.noreply.github.com> Date: Sat, 3 Feb 2024 12:42:39 -0300 Subject: [PATCH] fix _updatePeers calling two times for sender --- client/src/hooks/usePeer.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/hooks/usePeer.ts b/client/src/hooks/usePeer.ts index 6964255..33bfc23 100644 --- a/client/src/hooks/usePeer.ts +++ b/client/src/hooks/usePeer.ts @@ -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" }); @@ -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) => { // TODO https://peerjs.com/docs/#peeron-error