From 077df1ec9856d312bcf436c23b83945edbb7a7f3 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sun, 13 Nov 2022 14:45:04 +0200 Subject: [PATCH] Fix all teams showing without map pool --- app/routes/to.$identifier/teams.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/routes/to.$identifier/teams.tsx b/app/routes/to.$identifier/teams.tsx index 0c94354e4..ad29d5ba4 100644 --- a/app/routes/to.$identifier/teams.tsx +++ b/app/routes/to.$identifier/teams.tsx @@ -15,6 +15,16 @@ export default function TournamentToolsTeamsPage() { return (
{data.teams.map((team) => { + const hasMapPool = () => { + // before start empty array is returned if team has map list + // after start empty array means team has no map list + if (data.event.isBeforeStart) { + return Boolean(team.mapPool); + } + + return team.mapPool && team.mapPool.length > 0; + }; + return (
@@ -25,7 +35,7 @@ export default function TournamentToolsTeamsPage() { height={16} width={16} /> - {team.mapPool && team.mapPool.length > 0 ? ( + {hasMapPool() ? ( ) : (