Fix LUTI play-offs showing wrong dates

This commit is contained in:
Kalle
2025-04-16 17:51:21 +03:00
parent b71b606913
commit 5036d8db29
2 changed files with 8 additions and 0 deletions

View File

@@ -94,5 +94,10 @@ function Deadline({ roundId, bestOf }: { roundId: number; bestOf: number }) {
function useLeagueWeekStart(roundId: number) {
const tournament = useTournament();
const bracketIdx = tournament.brackets.findIndex((b) =>
b.data.round.some((r) => r.id === roundId),
);
if (bracketIdx !== 0) return null;
return resolveLeagueRoundStartDate(tournament, roundId);
}

View File

@@ -12,6 +12,7 @@ const MINUTES = {
BO3: 30,
BO5: 40,
BO7: 50,
BO9: 60,
};
const STRICT_MINUTES = {
@@ -19,6 +20,7 @@ const STRICT_MINUTES = {
BO3: 25,
BO5: 35,
BO7: 45,
BO9: 55,
};
const minutesToPlay = (count: number, strict: boolean) => {
@@ -26,6 +28,7 @@ const minutesToPlay = (count: number, strict: boolean) => {
if (count === 3) return strict ? STRICT_MINUTES.BO3 : MINUTES.BO3;
if (count === 5) return strict ? STRICT_MINUTES.BO5 : MINUTES.BO5;
if (count === 7) return strict ? STRICT_MINUTES.BO7 : MINUTES.BO7;
if (count === 9) return strict ? STRICT_MINUTES.BO9 : MINUTES.BO9;
logger.warn("Unknown best of count", { count });
return MINUTES.BO5;