Fix can't prepare maps in two day tournaments

This commit is contained in:
Kalle
2025-01-05 11:46:05 +02:00
parent 34c43da2f3
commit df6784f593
2 changed files with 5 additions and 0 deletions

View File

@@ -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";
@@ -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:
@@ -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),

View File

@@ -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</>
)}{" "}