fix(race-setup): wizard builds qualifying as Q/H heats; guide gets race day step by step (1.58.0)

This commit is contained in:
larssand committed 2026-11-04 16:35:31 +01:00
1 parent e1ca72db51
commit afb8829b16
9 files changed
+77 -36

No files matched your search

+3 -14
View File
@@ -530,7 +530,6 @@ export function buildRaceSessionsFromWizard(event, draft, { t, buildRaceSession
const driverIds = event.raceConfig.driverIds || [];
const created = [];
const practiceCount = Math.max(0, Number(draft.practiceSessions || 0) || 0);
const qualRounds = Math.max(0, Number(draft.qualifyingRounds || 0) || 0);
if (draft.createPractice && practiceCount > 0) {
for (let index = 1; index <= practiceCount; index += 1) {
created.push(
@@ -542,19 +541,9 @@ export function buildRaceSessionsFromWizard(event, draft, { t, buildRaceSession
);
}
}
if (draft.createQualifying && qualRounds > 0) {
for (let index = 1; index <= qualRounds; index += 1) {
created.push(
buildRaceSession(event.id, `${t("session.qualification")} ${index}`, "qualification", event.raceConfig.qualDurationMin, {
driverIds,
startMode: event.raceConfig.qualStartMode,
seedBestLapCount: event.raceConfig.qualSeedLapCount,
seedMethod: event.raceConfig.qualSeedMethod,
followUpSec: event.raceConfig.followUpSec,
})
);
}
}
// Qualifying is not built here: the wizard sets raceConfig.qualifyingRounds and calls
// generateQualifyingForRace, so the heats are split per "drivers per heat" and named
// Q<round> H<heat> - and "Create qualifying from practice" later replaces them.
if (draft.createTeamRace) {
created.push(
buildRaceSession(event.id, t("events.team_race"), "team_race", Math.max(1, Number(draft.teamRaceDurationMin || event.raceConfig.finalDurationMin || 1)), {