From 6f83d99c6b8c73bfd23acb217c03f16f6937d9b2 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Sun, 3 Aug 2025 11:40:31 +0200 Subject: [PATCH] bug: Correctly show ConfigureRound, StartRound and End actions for tournaments --- .../tournaments/queries/getAvailableTournamentActions.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/convex/_model/tournaments/queries/getAvailableTournamentActions.ts b/convex/_model/tournaments/queries/getAvailableTournamentActions.ts index e55fe23a..b4d5fc8f 100644 --- a/convex/_model/tournaments/queries/getAvailableTournamentActions.ts +++ b/convex/_model/tournaments/queries/getAvailableTournamentActions.ts @@ -67,11 +67,11 @@ export const getAvailableTournamentActions = async ( actions.push(TournamentActionKey.Start); } - if (isOrganizer && !hasCurrentRound && hasNextRound && nextRoundPairingCount === 0) { + if (isOrganizer && tournament.status === 'active' && !hasCurrentRound && hasNextRound && nextRoundPairingCount === 0) { actions.push(TournamentActionKey.ConfigureRound); } - if (isOrganizer && !hasCurrentRound && hasNextRound && nextRoundPairingCount > 0) { + if (isOrganizer && tournament.status === 'active' && !hasCurrentRound && hasNextRound && nextRoundPairingCount > 0) { actions.push(TournamentActionKey.StartRound); } @@ -83,7 +83,7 @@ export const getAvailableTournamentActions = async ( actions.push(TournamentActionKey.EndRound); } - if (isOrganizer && !hasCurrentRound) { + if (isOrganizer && tournament.status === 'active' && !hasCurrentRound) { actions.push(TournamentActionKey.End); }