forked from Shiloh/remnantchat
fix: display correct number of current peers
This commit is contained in:
parent
88a285778c
commit
5e24d5f1d3
@ -40,8 +40,9 @@ export function useRoom(
|
|||||||
() => new PeerRoom({ password: password ?? roomId, ...roomConfig }, roomId)
|
() => new PeerRoom({ password: password ?? roomId, ...roomConfig }, roomId)
|
||||||
)
|
)
|
||||||
|
|
||||||
const [numberOfPeers, setNumberOfPeers] = useState(1) // Includes this peer
|
|
||||||
const {
|
const {
|
||||||
|
numberOfPeers,
|
||||||
|
setNumberOfPeers,
|
||||||
setDoShowPeers,
|
setDoShowPeers,
|
||||||
peerList,
|
peerList,
|
||||||
setPeerList,
|
setPeerList,
|
||||||
@ -207,7 +208,6 @@ export function useRoom(
|
|||||||
|
|
||||||
const newNumberOfPeers = numberOfPeers + 1
|
const newNumberOfPeers = numberOfPeers + 1
|
||||||
setNumberOfPeers(newNumberOfPeers)
|
setNumberOfPeers(newNumberOfPeers)
|
||||||
setNumberOfPeers(newNumberOfPeers)
|
|
||||||
;(async () => {
|
;(async () => {
|
||||||
try {
|
try {
|
||||||
const promises: Promise<any>[] = [sendPeerId(userId, peerId)]
|
const promises: Promise<any>[] = [sendPeerId(userId, peerId)]
|
||||||
|
Loading…
Reference in New Issue
Block a user