Skip to content

Commit

Permalink
Fix can't prepare maps in two day tournaments
Browse files Browse the repository at this point in the history
  • Loading branch information
Sendouc committed Jan 5, 2025
1 parent 34c43da commit df6784f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/features/tournament-bracket/core/Tournament.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { modesShort, rankedModesShort } from "~/modules/in-game-lists/modes";
import { isAdmin } from "~/permissions";
import { removeDuplicates } from "~/utils/arrays";
import {
databaseTimestampNow,
databaseTimestampToDate,
dateToDatabaseTimestamp,
} from "~/utils/dates";
Expand Down Expand Up @@ -198,6 +199,7 @@ export class Tournament {
sources,
createdAt: null,
canBeStarted:
(!startTime || startTime < databaseTimestampNow()) &&
checkedInTeams.length >= TOURNAMENT.ENOUGH_TEAMS_TO_START &&
(sources ? relevantMatchesFinished : this.regularCheckInHasEnded),
teamsPendingCheckIn:
Expand Down Expand Up @@ -242,6 +244,7 @@ export class Tournament {
sources,
createdAt: null,
canBeStarted:
(!startTime || startTime < databaseTimestampNow()) &&
checkedInTeamsWithReplaysAvoided.length >=
TOURNAMENT.ENOUGH_TEAMS_TO_START &&
(sources ? relevantMatchesFinished : this.regularCheckInHasEnded),
Expand Down
2 changes: 2 additions & 0 deletions app/features/tournament-bracket/routes/to.$id.brackets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,8 @@ export default function TournamentBracketsPage() {
⚠️{" "}
{bracketIdx === 0 ? (
<>Tournament start time is in the future</>
) : bracket.startTime && bracket.startTime > new Date() ? (
<>Bracket start time is in the future</>
) : (
<>Teams pending from the previous bracket</>
)}{" "}
Expand Down

0 comments on commit df6784f

Please sign in to comment.