From 9d9f60eeb167461b5fab7bb071526b7fd4de25c3 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sat, 16 Apr 2022 21:07:08 +0300 Subject: [PATCH] Fix one more place match.pos -> num --- app/components/tournament/DuringMatchActions.tsx | 2 +- app/services/bracket.ts | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) 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"