From 48f9f762595dc1c18643e25fa187824ddeaef89e Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Tue, 23 May 2023 23:16:19 +0300 Subject: [PATCH] Don't load streams for tournament if before start --- app/features/tournament/routes/to.$id.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/features/tournament/routes/to.$id.tsx b/app/features/tournament/routes/to.$id.tsx index f0a139ad3..bddf1cf70 100644 --- a/app/features/tournament/routes/to.$id.tsx +++ b/app/features/tournament/routes/to.$id.tsx @@ -95,7 +95,9 @@ export const loader = async ({ params, request }: LoaderArgs) => { teams: censorMapPools(teams), mapListGeneratorAvailable, hasStarted, - streamsCount: (await streamsByTournamentId(tournamentId)).length, + streamsCount: hasStarted + ? (await streamsByTournamentId(tournamentId)).length + : 0, }; function censorMapPools(