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)]