diff --git a/app/components/tournament/DuringMatchActions.tsx b/app/components/tournament/DuringMatchActions.tsx index e376c717c..9014eb57a 100644 --- a/app/components/tournament/DuringMatchActions.tsx +++ b/app/components/tournament/DuringMatchActions.tsx @@ -32,7 +32,7 @@ export function DuringMatchActions({ const currentPosition = currentMatch.score?.reduce((acc, cur) => acc + cur, 1) ?? 1; const currentStage = currentRound.stages.find( - (m) => m.position === currentPosition + (s) => s.position === currentPosition ); invariant(currentStage, "currentStage is undefined"); const { stage } = currentStage; diff --git a/app/services/bracket.ts b/app/services/bracket.ts index 8e3de5941..e19ba3f6a 100644 --- a/app/services/bracket.ts +++ b/app/services/bracket.ts @@ -405,11 +405,8 @@ function newParticipantsForMatches({ .find(({ id }) => id === match.loserDestinationMatchId); invariant(losersMatch, "losersMatch undefined"); - // TODO: probably this is not correct: https://github.com/Sendouc/sendou.ink/issues/819 - // not sure where position = 0 comes from - // --- // if the match will have a BYE then we need to generate one more participant - if (losersMatch.position === 0) { + if (losersMatch.number === 0) { invariant( losersMatch.winnerDestinationMatchId, "losersMatch.winnerDestinationMatchId undefined"