fix: display correct number of current peers

This commit is contained in:
Jeremy Kahn 2022-11-27 19:17:12 -06:00
parent 88a285778c
commit 5e24d5f1d3

View File

@ -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<any>[] = [sendPeerId(userId, peerId)]