Count league divisions for the current season, not when it was started

This commit is contained in:
Kalle 2026-05-01 15:36:32 +03:00
parent 2d3bff6437
commit 609bb2de7a

View File

@ -65,7 +65,10 @@ export const action = async ({ request, params }: ActionFunctionArgs) => {
const results = allMatchResultsByTournamentId(tournamentId);
invariant(results.length > 0, "No results found");
const season = Seasons.current(tournament.ctx.startTime)?.nth;
const seasonAttributionDate = tournament.isLeagueDivision
? new Date()
: tournament.ctx.startTime;
const season = Seasons.current(seasonAttributionDate)?.nth;
const seedingSkillCountsFor = tournament.skillCountsFor;
const standingsResult = Standings.tournamentStandings(tournament);