mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-04-25 07:32:19 -05:00
Fix tournament team page crash before tournament starts
This commit is contained in:
parent
505915d694
commit
a150925aad
|
|
@ -34,7 +34,6 @@ import { Popover } from "~/components/Popover";
|
|||
import type { TournamentMaplistSource } from "~/modules/tournament-map-list-generator";
|
||||
import type { FindTeamsByTournamentIdItem } from "../queries/findTeamsByTournamentId.server";
|
||||
import hasTournamentStarted from "../queries/hasTournamentStarted.server";
|
||||
import invariant from "tiny-invariant";
|
||||
|
||||
export const loader = ({ params }: LoaderArgs) => {
|
||||
const tournamentId = tournamentIdFromParams(params);
|
||||
|
|
@ -43,12 +42,10 @@ export const loader = ({ params }: LoaderArgs) => {
|
|||
const manager = getTournamentManager("SQL");
|
||||
|
||||
const bracket = manager.get.tournamentData(tournamentId);
|
||||
invariant(
|
||||
bracket.stage.length === 1,
|
||||
"Bracket doesn't have exactly one stage",
|
||||
);
|
||||
const stage = bracket.stage[0];
|
||||
|
||||
// TODO: handle placement when multiple stages
|
||||
|
||||
const _everyMatchIsOver = everyMatchIsOver(bracket);
|
||||
const standing = _everyMatchIsOver
|
||||
? finalStandingOfTeam({
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user