From 58727249e4fdfb27d5b6fccc8d4bec246e42aa3a Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sun, 3 Dec 2023 11:15:55 +0200 Subject: [PATCH] Handle special case where tournament was started early --- app/features/tournament/routes/to.$id.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/features/tournament/routes/to.$id.tsx b/app/features/tournament/routes/to.$id.tsx index 8141e0246..ee9d23fe2 100644 --- a/app/features/tournament/routes/to.$id.tsx +++ b/app/features/tournament/routes/to.$id.tsx @@ -79,7 +79,11 @@ export const loader = async ({ params, request }: LoaderArgs) => { const hasStarted = hasTournamentStarted(tournamentId); let teams = findTeamsByTournamentId(tournamentId); if (hasStarted) { - teams = teams.filter(teamHasCheckedIn); + const checkedInTeams = teams.filter(teamHasCheckedIn); + // handle special case where tournament was started early + if (checkedInTeams.length > 0) { + teams = checkedInTeams; + } } const teamMemberOfName = teams.find((team) =>