From 0e671fb41b3015b235568aae87eb2a6dc2b47b96 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sun, 3 Dec 2023 11:11:47 +0200 Subject: [PATCH] All Bo5 for invite event --- .../tournament-bracket/routes/to.$id.brackets.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/features/tournament-bracket/routes/to.$id.brackets.tsx b/app/features/tournament-bracket/routes/to.$id.brackets.tsx index 605d301cb..e73428fed 100644 --- a/app/features/tournament-bracket/routes/to.$id.brackets.tsx +++ b/app/features/tournament-bracket/routes/to.$id.brackets.tsx @@ -81,7 +81,10 @@ import { } from "~/features/mmr"; import { queryTeamPlayerRatingAverage } from "~/features/mmr/mmr-utils.server"; import * as TournamentRepository from "~/features/tournament/TournamentRepository.server"; -import { HACKY_maxRosterSizeBeforeStart } from "~/features/tournament/tournament-utils"; +import { + HACKY_isInviteOnlyEvent, + HACKY_maxRosterSizeBeforeStart, +} from "~/features/tournament/tournament-utils"; export const links: LinksFunction = () => { return [ @@ -138,9 +141,11 @@ export const action: ActionFunction = async ({ params, request }) => { settings: resolveTournamentStageSettings(tournament.format), }); - const bestOfs = resolveBestOfs( - findAllMatchesByTournamentId(tournamentId), - ); + const matches = findAllMatchesByTournamentId(tournamentId); + // TODO: dynamic best of set when bracket is made + const bestOfs = HACKY_isInviteOnlyEvent(tournament) + ? matches.map((match) => [5, match.matchId] as [5, number]) + : resolveBestOfs(matches); for (const [bestOf, id] of bestOfs) { setBestOf({ bestOf, id }); }