Fix crash when visiting tournament team page after tournament start who did not check in
Some checks are pending
E2E Tests / e2e (push) Waiting to run
Tests and checks on push / run-checks-and-tests (push) Waiting to run
Updates translation progress / update-translation-progress-issue (push) Waiting to run

This commit is contained in:
Kalle
2026-05-12 21:01:49 +03:00
parent 9ce94d71c5
commit 1f415533f5

View File

@@ -17,7 +17,9 @@ export const loader = async ({ params }: LoaderFunctionArgs) => {
});
const tournament = await tournamentDataCached({ tournamentId });
if (!tournament?.ctx.teams.some((t) => t.id === tournamentTeamId)) {
const team = tournament?.ctx.teams.find((t) => t.id === tournamentTeamId);
const tournamentHasStarted = (tournament?.data.stage.length ?? 0) > 0;
if (!team || (tournamentHasStarted && team.checkIns.length === 0)) {
throw new Response(null, { status: 404 });
}