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); }