Skip to content

Commit

Permalink
Fix handleSplitUsers() to include last user when number of users was odd
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Fosco committed Jan 23, 2024
1 parent af7caf0 commit af292e5
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit af292e5

Please sign in to comment.