From af292e5d8459d0769bc0eef82edf46cb78e4660b Mon Sep 17 00:00:00 2001 From: Daniel Fosco Date: Tue, 23 Jan 2024 15:27:12 +0100 Subject: [PATCH] Fix handleSplitUsers() to include last user when number of users was odd --- .../src/components/BreakoutManager/BreakoutManager.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/breakout-rooms/src/components/BreakoutManager/BreakoutManager.tsx b/examples/breakout-rooms/src/components/BreakoutManager/BreakoutManager.tsx index 56f320c7f..0052fa4b0 100644 --- a/examples/breakout-rooms/src/components/BreakoutManager/BreakoutManager.tsx +++ b/examples/breakout-rooms/src/components/BreakoutManager/BreakoutManager.tsx @@ -131,11 +131,10 @@ export const BreakoutManager: React.FC = () => { const handleSplitUsers = async () => { const count = rooms.length; - + // This needs to be only new users const users = unassignedUsers; - const roomSize = Math.max(Math.floor(users.length / count), 1); - + const roomSize = Math.max(Math.ceil(users.length / count), 1); const usersInRooms: OnlineUserInfo[][] = []; for (let i = 0; i < users.length; i += roomSize) {