Skip to content

Commit

Permalink
fixed bug with teamToPlayerArray function
Browse files Browse the repository at this point in the history
  • Loading branch information
qsenn35 committed Jun 9, 2022
1 parent 758d229 commit fbba8d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion teamSorter.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ const calcTeamValue = (team) => {

const teamToPlayerArray = (team) => {
return Object.entries(team).map(([role, player]) => {
player.assignedRole = role;
if (player)
player.assignedRole = role;
return player;
});
};
Expand Down Expand Up @@ -336,6 +337,7 @@ const balanceTeamsByRank = (teamOne, teamTwo) => {
bot: null,
support: null,
};
console.log(teamOne, teamTwo);
const teamOnePlayers = teamToPlayerArray(teamOne);
const teamTwoPlayers = teamToPlayerArray(teamTwo);
const mergedPlayers = [...teamOnePlayers, ...teamTwoPlayers];
Expand Down

0 comments on commit fbba8d9

Please sign in to comment.