Fix one more place match.pos -> num

This commit is contained in:
Kalle
2022-04-16 21:07:08 +03:00
parent bf6236161a
commit 9d9f60eeb1
2 changed files with 2 additions and 5 deletions

View File

@@ -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;

View File

@@ -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"