From 5e24d5f1d3c465445b4494fffa21ceedca041409 Mon Sep 17 00:00:00 2001 From: Jeremy Kahn Date: Sun, 27 Nov 2022 19:17:12 -0600 Subject: [PATCH] fix: display correct number of current peers --- src/components/Room/useRoom.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Room/useRoom.ts b/src/components/Room/useRoom.ts index 805d998..cbdf572 100644 --- a/src/components/Room/useRoom.ts +++ b/src/components/Room/useRoom.ts @@ -40,8 +40,9 @@ export function useRoom( () => new PeerRoom({ password: password ?? roomId, ...roomConfig }, roomId) ) - const [numberOfPeers, setNumberOfPeers] = useState(1) // Includes this peer const { + numberOfPeers, + setNumberOfPeers, setDoShowPeers, peerList, setPeerList, @@ -207,7 +208,6 @@ export function useRoom( const newNumberOfPeers = numberOfPeers + 1 setNumberOfPeers(newNumberOfPeers) - setNumberOfPeers(newNumberOfPeers) ;(async () => { try { const promises: Promise[] = [sendPeerId(userId, peerId)]