From 2cae28988acd2d1ca1a631b00a02f17405dfe538 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sun, 2 Jul 2023 11:45:28 +0300 Subject: [PATCH] Improve error messages when can't report score --- .../components/ScoreReporterRosters.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/features/tournament-bracket/components/ScoreReporterRosters.tsx b/app/features/tournament-bracket/components/ScoreReporterRosters.tsx index 879f317b3..2b4316b1d 100644 --- a/app/features/tournament-bracket/components/ScoreReporterRosters.tsx +++ b/app/features/tournament-bracket/components/ScoreReporterRosters.tsx @@ -131,6 +131,14 @@ function ReportScoreButtons({ }) { const { t } = useTranslation(["game-misc"]); + if (checkedPlayers.some((team) => team.length === 0)) { + return ( +
+ Please select rosters to report the score +
+ ); + } + if ( !checkedPlayers.every( (team) => team.length === TOURNAMENT.TEAM_MIN_MEMBERS_FOR_FULL @@ -138,8 +146,8 @@ function ReportScoreButtons({ ) { return (- Please choose exactly {TOURNAMENT.TEAM_MIN_MEMBERS_FOR_FULL}+ - {TOURNAMENT.TEAM_MIN_MEMBERS_FOR_FULL} players to report score + Please choose {TOURNAMENT.TEAM_MIN_MEMBERS_FOR_FULL} players from both + teams to report the score
); }