Skip to content

Commit

Permalink
fix: handeSplitBoards bug and refactor generate subBoards loop
Browse files Browse the repository at this point in the history
  • Loading branch information
nunocaseiro committed May 2, 2022
1 parent b0d6488 commit 0710e28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/hooks/useCreateBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const useCreateBoard = (team: Team) => {
const handleSplitBoards = useCallback(
(maxTeams: number) => {
const subBoards: BoardToAdd[] = [];
const splitedUsers: BoardUserToAdd[][] = [];
const splitedUsers: BoardUserToAdd[][] = new Array(maxTeams).fill([]);

let availableUsers = [...teamMembers];

Expand All @@ -69,7 +69,7 @@ const useCreateBoard = (team: Team) => {

if (j >= maxTeams) j = 0;
splitedUsers[j] = [
...(splitedUsers[j] ?? []),
...splitedUsers[j],
{
user: teamUser.user,
role: BoardUserRoles.MEMBER,
Expand Down

0 comments on commit 0710e28

Please sign in to comment.