Skip to content

Commit

Permalink
Update transformPlayerMatches.js
Browse files Browse the repository at this point in the history
  • Loading branch information
howardchung committed Mar 12, 2024
1 parent 8e5df9d commit a98c9e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/actions/transformPlayerMatches.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export default function transformPlayerMatches(fields) {
if (fields.included_account_id && !Array.isArray(fields.included_account_id)) {
return response.map((match) => {
let sameTeam = false;
const match = Object.entries(match.heroes).find(([key, val]) => val.account_id && val.account_id.toString() === fields.included_account_id);
const partnerHero = {...match?.val, player_slot: match?.key};
const found = Object.entries(match.heroes).find(([key, val]) => val.account_id && val.account_id.toString() === fields.included_account_id);
const partnerHero = {...found?.val, player_slot: found?.key};
if (isRadiant(partnerHero.player_slot) === isRadiant(match.player_slot)) {
sameTeam = true;
}
Expand Down

0 comments on commit a98c9e2

Please sign in to comment.