️(frontend) optimize enterRoom calls in useWaitingParticipants

Replace sequential await inside the loop with Promise.all, since
each enterRoom call is independent.

This prevents unnecessary delays when multiple participants are
waiting (e.g. 10 participants previously resulted in ~10x longer
execution time).
This commit is contained in:
lebaudantoine
2026-03-03 19:19:23 +01:00
committed by aleb_the_flash
parent 42647d6d25
commit 4ad897e756

View File

@@ -74,13 +74,17 @@ export const useWaitingParticipants = () => {
): Promise<void> => {
try {
setListEnabled(false)
for (const participant of waitingParticipants) {
await enterRoom({
await Promise.all(
waitingParticipants.map((participant) =>
enterRoom({
roomId: roomId,
allowEntry,
participantId: participant.id,
})
}
)
)
await refetchWaiting()
} catch (e) {
console.error(e)