fix(timing): keep timing the running session when another one is selected
Passings and the session clock followed only the selected session, so selecting another practice or the next heat while one was running dropped every lap. They now go to the running session, and Timing and Race Day show where laps are being recorded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cdde070c1c
commit
3a6789f42f
13 files changed
+137
-13
No files matched your search
+17
-8
@@ -17,7 +17,7 @@ import { renderRaceFormatField, renderRaceFormatContextCard, getRaceSummaryItems
|
||||
|
||||
import { normalizeRaceTeam as normalizeRaceTeamLogic, normalizeStoredRacePreset as normalizeStoredRacePresetLogic, getRaceFormatPresets as getRaceFormatPresetsLogic, applyRaceFormatPreset as applyRaceFormatPresetLogic, buildRaceFormatConfigFromForm as buildRaceFormatConfigFromFormLogic, normalizeEvent as normalizeEventLogic, normalizeBrandingConfig as normalizeBrandingConfigLogic, resolveEventBranding as resolveEventBrandingLogic, getRaceManageStatuses as getRaceManageStatusesLogic, buildDefaultRaceWizardDraft as buildDefaultRaceWizardDraftLogic, getRaceWizardPreset as getRaceWizardPresetLogic, applyRaceWizardPresetDefaults as applyRaceWizardPresetDefaultsLogic, ensureRaceParticipantsConfigured as ensureRaceParticipantsConfiguredLogic, buildRaceSession as buildRaceSessionLogic, buildOpenPracticeBundle as buildOpenPracticeBundleLogic, buildTrackSession as buildTrackSessionLogic, createSponsorRounds as createSponsorRoundsLogic, buildRaceSessionsFromWizard as buildRaceSessionsFromWizardLogic, getRaceWizardSessionPlan as getRaceWizardSessionPlanLogic, getEventDrivers as getEventDriversLogic, getEventTeams as getEventTeamsLogic, getTeamDriverPool as getTeamDriverPoolLogic, reassignTeamMembers as reassignTeamMembersLogic, findEventTeamForPassing as findEventTeamForPassingLogic, generateQualifyingForRace as generateQualifyingForRaceLogic, reseedUpcomingQualifying as reseedUpcomingQualifyingLogic, moveDriversIntoQualifyingHeat as moveDriversIntoQualifyingHeatLogic, parseQualifyingHeatName as parseQualifyingHeatNameLogic, generateFinalsForRace as generateFinalsForRaceLogic, applyBumpsForRace as applyBumpsForRaceLogic, buildEventSchedule as buildEventScheduleLogic } from "./event_race_logic.js";
|
||||
|
||||
import { getSessionTypeLabel as getSessionTypeLabelLogic, getStatusLabel as getStatusLabelLogic, isUntimedSession as isUntimedSessionLogic, getActiveSession as getActiveSessionLogic, getSessionTargetMs as getSessionTargetMsLogic, getSessionLapWindow as getSessionLapWindowLogic, isCountedPassing as isCountedPassingLogic, getVisiblePassings as getVisiblePassingsLogic, getPassingValidationLabel as getPassingValidationLabelLogic, getSessionTiming as getSessionTimingLogic, ensureSessionResult as ensureSessionResultLogic, buildLeaderboard as buildLeaderboardLogic, formatLapDelta as formatLapDeltaLogic, formatLeaderboardGap as formatLeaderboardGapLogic, getCompetitorElapsedMs as getCompetitorElapsedMsLogic, getCompetitorPassings as getCompetitorPassingsLogic, getCompetitorSeedMetric as getCompetitorSeedMetricLogic, getSessionEntrants as getSessionEntrantsLogic, buildPracticeStandings as buildPracticeStandingsLogic, getQualifyingPointsValue as getQualifyingPointsValueLogic, isHighPointsTable as isHighPointsTableLogic, compareNumberSet as compareNumberSetLogic, buildQualifyingTieBreakNote as buildQualifyingTieBreakNoteLogic, hasQualifyingPrimaryTie as hasQualifyingPrimaryTieLogic, buildQualifyingStandings as buildQualifyingStandingsLogic, formatTeamActiveMemberLabel as formatTeamActiveMemberLabelLogic, buildTeamRaceStandings as buildTeamRaceStandingsLogic, buildSessionChannelStats as buildSessionChannelStatsLogic, buildTeamStintLog as buildTeamStintLogLogic, getSessionGridEntries as getSessionGridEntriesLogic, getSessionGridOrder as getSessionGridOrderLogic, ensureSessionDriverOrder as ensureSessionDriverOrderLogic, buildFinalStandings as buildFinalStandingsLogic, getTrackRecordMs as getTrackRecordMsLogic } from "./timing_logic.js";
|
||||
import { getSessionTypeLabel as getSessionTypeLabelLogic, getStatusLabel as getStatusLabelLogic, isUntimedSession as isUntimedSessionLogic, getActiveSession as getActiveSessionLogic, getLiveSession as getLiveSessionLogic, getSessionTargetMs as getSessionTargetMsLogic, getSessionLapWindow as getSessionLapWindowLogic, isCountedPassing as isCountedPassingLogic, getVisiblePassings as getVisiblePassingsLogic, getPassingValidationLabel as getPassingValidationLabelLogic, getSessionTiming as getSessionTimingLogic, ensureSessionResult as ensureSessionResultLogic, buildLeaderboard as buildLeaderboardLogic, formatLapDelta as formatLapDeltaLogic, formatLeaderboardGap as formatLeaderboardGapLogic, getCompetitorElapsedMs as getCompetitorElapsedMsLogic, getCompetitorPassings as getCompetitorPassingsLogic, getCompetitorSeedMetric as getCompetitorSeedMetricLogic, getSessionEntrants as getSessionEntrantsLogic, buildPracticeStandings as buildPracticeStandingsLogic, getQualifyingPointsValue as getQualifyingPointsValueLogic, isHighPointsTable as isHighPointsTableLogic, compareNumberSet as compareNumberSetLogic, buildQualifyingTieBreakNote as buildQualifyingTieBreakNoteLogic, hasQualifyingPrimaryTie as hasQualifyingPrimaryTieLogic, buildQualifyingStandings as buildQualifyingStandingsLogic, formatTeamActiveMemberLabel as formatTeamActiveMemberLabelLogic, buildTeamRaceStandings as buildTeamRaceStandingsLogic, buildSessionChannelStats as buildSessionChannelStatsLogic, buildTeamStintLog as buildTeamStintLogLogic, getSessionGridEntries as getSessionGridEntriesLogic, getSessionGridOrder as getSessionGridOrderLogic, ensureSessionDriverOrder as ensureSessionDriverOrderLogic, buildFinalStandings as buildFinalStandingsLogic, getTrackRecordMs as getTrackRecordMsLogic } from "./timing_logic.js";
|
||||
import { normalizeTrackLayouts, getTrackLayoutIdAt, getTrackLayoutLabel, nextTrackLayoutLabel, findRaceSessionBlockingLayoutChange, isPracticeSessionType, isTrackLayoutInUse } from "./track_layouts_logic.js";
|
||||
|
||||
import { renderDashboardView, renderClassesView, renderDriversView, renderCarsView } from "./core_views.js";
|
||||
@@ -90,6 +90,7 @@ const getSessionTypeLabel = (type) => getSessionTypeLabelLogic(type, { t });
|
||||
const getStatusLabel = (status) => getStatusLabelLogic(status, { t });
|
||||
const isUntimedSession = (session) => isUntimedSessionLogic(session);
|
||||
const getActiveSession = () => getActiveSessionLogic({ state });
|
||||
const getLiveSession = () => getLiveSessionLogic({ state });
|
||||
const normalizeSeriesList = (list) => (Array.isArray(list) ? list : []).map((series) => normalizeSeries(series, { uid })).filter((series) => series.id);
|
||||
const getSessionTargetMs = (session) => getSessionTargetMsLogic(session, { isUntimedSession });
|
||||
const getSessionLapWindow = (session) => getSessionLapWindowLogic(session, { state });
|
||||
@@ -180,7 +181,7 @@ const getSpeechVoices = () => getSpeechVoicesHelper();
|
||||
const speakText = (text, options = {}) => speakTextHelper(text, { state, currentLanguage }, options);
|
||||
const triggerRaceAudio = (eventKey, options = {}) => {
|
||||
// The Settings test buttons use force: they must sound even with no session running.
|
||||
if (!options.force && isSilencedDuringRace(eventKey, state.settings.raceAudio, getActiveSession())) return { skipped: true, voiceDone: Promise.resolve(false) };
|
||||
if (!options.force && isSilencedDuringRace(eventKey, state.settings.raceAudio, getLiveSession())) return { skipped: true, voiceDone: Promise.resolve(false) };
|
||||
return raceAudioEngine.trigger(eventKey, options);
|
||||
};
|
||||
const getPassingSoundProfile = (entry) => {
|
||||
@@ -194,9 +195,11 @@ const announcePassing = (entry) => {
|
||||
}
|
||||
};
|
||||
const announceRaceStarted = (session) => announceRaceStartedHelper(session, { t, pushOverlayEvent });
|
||||
const announceRaceFinished = () => {
|
||||
const session = getActiveSession();
|
||||
announceRaceFinishedHelper({ t, getActiveSession, pushOverlayEvent });
|
||||
// `finished` is the session that just ended (the timer may finish a running heat while the
|
||||
// next one is already selected); manual finish selects the session first, so the default holds.
|
||||
const announceRaceFinished = (finished = null) => {
|
||||
const session = finished || getActiveSession();
|
||||
announceRaceFinishedHelper({ t, getActiveSession: () => session, pushOverlayEvent });
|
||||
if (!session || !state.settings.raceAudio?.enabled) return;
|
||||
triggerRaceAudio(session.type === "qualification" ? "qualifying_finished" : "race_finished", { interrupt: true, logData: { raceId: session.eventId, sessionId: session.id } });
|
||||
const podium = buildLeaderboard(session).slice(0, 3);
|
||||
@@ -204,7 +207,7 @@ const announceRaceFinished = () => {
|
||||
if (podium.length > 1) triggerRaceAudio("podium", { variables: { podium: podium.map((row) => row.displayName || row.driverName).join(", ") } });
|
||||
};
|
||||
const announceRaceClockEvent = (eventKey, session) => triggerRaceAudio(eventKey, { logData: { raceId: session.eventId, sessionId: session.id } });
|
||||
const handleSessionTimerTick = () => handleSessionTimerTickHelper({ getActiveSession, isUntimedSession, getSessionTiming, saveState, getLastFinishAnnouncementSessionId: () => lastFinishAnnouncementSessionId, setLastFinishAnnouncementSessionId: (value) => { lastFinishAnnouncementSessionId = value; }, announceRaceFinished, announceRaceClockEvent });
|
||||
const handleSessionTimerTick = () => handleSessionTimerTickHelper({ getActiveSession: getLiveSession, isUntimedSession, getSessionTiming, saveState, getLastFinishAnnouncementSessionId: () => lastFinishAnnouncementSessionId, setLastFinishAnnouncementSessionId: (value) => { lastFinishAnnouncementSessionId = value; }, announceRaceFinished, announceRaceClockEvent });
|
||||
const cancelRaceStart = () => raceAudioEngine.cancelStartSequence();
|
||||
const startSessionWithAudio = (session, callbacks) => {
|
||||
// Only the casual, come-and-go practice modes (open_practice - the standalone "Quick
|
||||
@@ -383,7 +386,8 @@ function setDriverTransponder(driverId, transponder) {
|
||||
const processDecoderMessage = (msg, decoderRole = "main") => processDecoderMessageHelper(msg, {
|
||||
state,
|
||||
t,
|
||||
getActiveSession,
|
||||
// Passings go to the session actually running (see getLiveSession), not only the selected one.
|
||||
getActiveSession: getLiveSession,
|
||||
ensureSessionResult,
|
||||
normalizeStartMode,
|
||||
getSessionLapWindow,
|
||||
@@ -420,6 +424,7 @@ const renderRaceDay = () => renderRaceDayView({
|
||||
getRaceDayWarmupCheck, setDriverTransponder, getDefaultPrologueSec,
|
||||
startRacePrologue, holdRacePrologue, resumeRacePrologue, setRacePrologueRemaining, cancelRacePrologue, goRacePrologue,
|
||||
isStartPending: (session) => Boolean(session && pendingStartSessionId === session.id),
|
||||
getLiveSession,
|
||||
renderSuspectLapsPanel: (session) => renderSuspectLapsPanelView(session, { t, escapeHtml, formatLap, ensureSessionResult }),
|
||||
setCompetitorLapStatus,
|
||||
addTrackLayout, renderView, state, dom, t, escapeHtml, formatLap, formatCountdown, formatElapsedClock,
|
||||
@@ -478,7 +483,7 @@ const refreshTimingDynamics = () => {
|
||||
node.textContent = clock;
|
||||
});
|
||||
};
|
||||
const renderTiming = () => renderTimingView({ state, dom, t, escapeHtml, formatLap, formatCountdown, formatElapsedClock, formatRaceClock, renderTable, uid, getActiveSession, ensureSessionResult, buildLeaderboard, getSessionTiming, getVisiblePassings, getEventName, getSessionTypeLabel, getStatusLabel, normalizeStartMode, getStartModeLabel, renderPositionGrid, renderSessionChannelAnalysis, connectDecoder, disconnectDecoder, applyCompetitorCorrection, invalidateCompetitorLastLap, restoreCompetitorLastInvalidLap, startOperationalSession, finishOperationalSession, cancelRaceStart, triggerRaceAudio, getStartLightState: () => raceAudioEngine.getStartLightState(), saveState, updateHeaderState, renderView, normalizeDriver, normalizeCar, processDecoderMessage, getSelectedLeaderboardKey: () => selectedLeaderboardKey, setSelectedLeaderboardKey: (value) => { selectedLeaderboardKey = value; }, getQuickAddDraft: () => quickAddDraft, setQuickAddDraft: (value) => { quickAddDraft = value; }, getPassingValidationLabel, isCountedPassing, getCompetitorPassings, getManualCorrectionSummary, formatTeamActiveMemberLabel, lastFinishAnnouncementSessionId: () => lastFinishAnnouncementSessionId, setLastFinishAnnouncementSessionId: (value) => { lastFinishAnnouncementSessionId = value; }, lastOverlayLeaderKeyBySession, lastOverlayTop3BySession, overlayEvents: () => overlayEvents, setOverlayEvents: (value) => { overlayEvents = value; }, sessionReplay, syncTrainingLedger, setCompetitorLapStatus, openJudging: (rowKey) => { selectedJudgeKey = rowKey; selectedLeaderboardKey = null; navigateToView("judging"); } });
|
||||
const renderTiming = () => renderTimingView({ state, dom, t, escapeHtml, formatLap, formatCountdown, formatElapsedClock, formatRaceClock, renderTable, uid, getActiveSession, ensureSessionResult, buildLeaderboard, getSessionTiming, getVisiblePassings, getEventName, getSessionTypeLabel, getStatusLabel, normalizeStartMode, getStartModeLabel, renderPositionGrid, renderSessionChannelAnalysis, connectDecoder, disconnectDecoder, applyCompetitorCorrection, invalidateCompetitorLastLap, restoreCompetitorLastInvalidLap, startOperationalSession, finishOperationalSession, cancelRaceStart, triggerRaceAudio, getStartLightState: () => raceAudioEngine.getStartLightState(), saveState, updateHeaderState, renderView, normalizeDriver, normalizeCar, processDecoderMessage, getSelectedLeaderboardKey: () => selectedLeaderboardKey, setSelectedLeaderboardKey: (value) => { selectedLeaderboardKey = value; }, getQuickAddDraft: () => quickAddDraft, setQuickAddDraft: (value) => { quickAddDraft = value; }, getPassingValidationLabel, isCountedPassing, getCompetitorPassings, getManualCorrectionSummary, formatTeamActiveMemberLabel, lastFinishAnnouncementSessionId: () => lastFinishAnnouncementSessionId, setLastFinishAnnouncementSessionId: (value) => { lastFinishAnnouncementSessionId = value; }, lastOverlayLeaderKeyBySession, lastOverlayTop3BySession, overlayEvents: () => overlayEvents, setOverlayEvents: (value) => { overlayEvents = value; }, sessionReplay, syncTrainingLedger, setCompetitorLapStatus, getLiveSession, selectLiveSession: (id) => selectOperationalSession(id), openJudging: (rowKey) => { selectedJudgeKey = rowKey; selectedLeaderboardKey = null; navigateToView("judging"); } });
|
||||
const renderJudging = () => renderJudgingView({ state, dom, t, escapeHtml, formatLap, renderTable, getActiveSession, ensureSessionResult, buildLeaderboard, getSessionTypeLabel, getJudgeFilteredRows, getJudgeFilteredLog, getCompetitorPassings, isCountedPassing, getPassingValidationLabel, undoJudgingAdjustment, applyCompetitorCorrection, invalidateCompetitorLastLap, restoreCompetitorLastInvalidLap, renderView, getSelectedJudgeKey: () => selectedJudgeKey, setSelectedJudgeKey: (value) => { selectedJudgeKey = value; }, getJudgingCompetitorFilter: () => judgingCompetitorFilter, setJudgingCompetitorFilter: (value) => { judgingCompetitorFilter = value; }, getJudgingLogFilter: () => judgingLogFilter, setJudgingLogFilter: (value) => { judgingLogFilter = value; } , setCompetitorLapStatus });
|
||||
const normalizeTrainingState = (training) => normalizeTrainingStateLogic(training, { uid });
|
||||
const syncTrainingLedger = () => {
|
||||
@@ -794,6 +799,8 @@ const TRANSLATIONS = {
|
||||
"series.step3": "3 · Deltävlingar ({count})",
|
||||
"series.step4": "4 · Ställning",
|
||||
"series.classes_all": "Alla",
|
||||
"timing.live_elsewhere": "Varv registreras just nu på \"{name}\", som pågår - inte på den valda sessionen.",
|
||||
"timing.show_live": "Visa den",
|
||||
"overlay.obs_show_position_change": "Placering sedan start (▲/▼) i race",
|
||||
"overlay.position_change_title": "Placeringar vunna (▲) eller förlorade (▼) sedan starten",
|
||||
"settings.public_address_title": "Publik adress (domän / DynDNS)",
|
||||
@@ -2600,6 +2607,8 @@ const TRANSLATIONS = {
|
||||
"series.step3": "3 · Rounds ({count})",
|
||||
"series.step4": "4 · Standings",
|
||||
"series.classes_all": "All",
|
||||
"timing.live_elsewhere": "Laps are being recorded on \"{name}\", which is running - not on the selected session.",
|
||||
"timing.show_live": "Show it",
|
||||
"overlay.obs_show_position_change": "Places since the start (▲/▼) in races",
|
||||
"overlay.position_change_title": "Places gained (▲) or lost (▼) since the start",
|
||||
"settings.public_address_title": "Public address (domain / DynDNS)",
|
||||
|
||||
@@ -174,7 +174,7 @@ export function renderRaceDayView(deps) {
|
||||
saveLapWindow, navigateTo, getStartLightState, addTrackLayout, renderView,
|
||||
getRaceDayWarmupCheck, setDriverTransponder, getDefaultPrologueSec,
|
||||
startRacePrologue, holdRacePrologue, resumeRacePrologue, setRacePrologueRemaining, cancelRacePrologue, goRacePrologue,
|
||||
isStartPending, renderSuspectLapsPanel = () => "", setCompetitorLapStatus = () => false,
|
||||
isStartPending, renderSuspectLapsPanel = () => "", setCompetitorLapStatus = () => false, getLiveSession = () => null,
|
||||
} = deps;
|
||||
const queue = buildRaceDayQueue(state);
|
||||
const session = queue.current;
|
||||
@@ -197,7 +197,11 @@ export function renderRaceDayView(deps) {
|
||||
const isSelected = Boolean(session && state.activeSessionId === session.id);
|
||||
const canStart = Boolean(session && preflight.ready && !["running", "paused"].includes(session.status) && !isStartPending?.(session));
|
||||
|
||||
// Another session is running while a different one is selected: say where laps go.
|
||||
const liveSession = getLiveSession();
|
||||
const liveElsewhere = liveSession && session && liveSession.id !== session.id && ["running", "paused"].includes(liveSession.status) ? liveSession : null;
|
||||
dom.view.innerHTML = `
|
||||
${liveElsewhere ? `<div class="live-elsewhere-banner" id="liveElsewhereBanner"><span>⏱ ${escapeHtml(t("timing.live_elsewhere", { name: liveElsewhere.name }))}</span><button class="btn btn-mini" type="button" data-show-live="${escapeHtml(liveElsewhere.id)}">${escapeHtml(t("timing.show_live"))}</button></div>` : ""}
|
||||
<section class="race-day-hero ${preflight.ready ? "is-ready" : "has-blockers"}">
|
||||
<div>
|
||||
<span class="race-day-kicker">${t("race_day.current")}</span>
|
||||
@@ -334,6 +338,7 @@ export function renderRaceDayView(deps) {
|
||||
if (!result.ok && result.message) alert(result.message);
|
||||
if (!result.ok && button) button.disabled = false;
|
||||
});
|
||||
dom.view.querySelector("[data-show-live]")?.addEventListener("click", (event) => selectSession(event.currentTarget.dataset.showLive));
|
||||
dom.view.querySelectorAll("[data-lap-action]").forEach((button) => button.addEventListener("click", () => {
|
||||
if (session && setCompetitorLapStatus(session, button.dataset.lapRow, Number(button.dataset.lapTs), button.dataset.lapAction)) renderView();
|
||||
}));
|
||||
|
||||
@@ -439,7 +439,7 @@ export function handleSessionTimerTickHelper({ getActiveSession, isUntimedSessio
|
||||
active.endedAt = Date.now();
|
||||
active.finishedByTimer = true;
|
||||
active.followUpStartedAt = null;
|
||||
if (getLastFinishAnnouncementSessionId() !== active.id) { announceRaceFinished(); setLastFinishAnnouncementSessionId(active.id); }
|
||||
if (getLastFinishAnnouncementSessionId() !== active.id) { announceRaceFinished(active); setLastFinishAnnouncementSessionId(active.id); }
|
||||
saveState();
|
||||
return { changed: true };
|
||||
}
|
||||
|
||||
@@ -4631,3 +4631,6 @@ tr.is-removed td.lap-actions {
|
||||
.overlay-position-change { font-weight: 800; font-variant-numeric: tabular-nums; }
|
||||
.overlay-position-change.is-up { color: #3ddc84; }
|
||||
.overlay-position-change.is-down { color: #ff6b6b; }
|
||||
|
||||
/* Laps are going to a running session other than the selected one */
|
||||
.live-elsewhere-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; padding: 10px 14px; border: 1px solid #f5a623; border-radius: 10px; background: color-mix(in srgb, #f5a623 14%, transparent); font-weight: 600; }
|
||||
@@ -25,6 +25,18 @@ export function getActiveSession({ state }) {
|
||||
return state.sessions.find((s) => s.id === state.activeSessionId) || null;
|
||||
}
|
||||
|
||||
// The session that is actually being timed. Normally the selected one; but if the selected
|
||||
// session isn't running or paused (the next heat picked on Race Day, another Open Practice
|
||||
// opened) while another session still runs, that running one - the most recently started -
|
||||
// keeps getting the passings and its clock, instead of every lap being dropped.
|
||||
export function getLiveSession({ state }) {
|
||||
const isLive = (session) => ["running", "paused"].includes(String(session?.status || ""));
|
||||
const active = getActiveSession({ state });
|
||||
if (isLive(active)) return active;
|
||||
const live = state.sessions.filter(isLive).sort((a, b) => Number(b.startedAt || 0) - Number(a.startedAt || 0));
|
||||
return live[0] || active;
|
||||
}
|
||||
|
||||
|
||||
|
||||
export function getSessionTargetMs(session, { isUntimedSession }) {
|
||||
|
||||
@@ -411,6 +411,7 @@ export function renderTimingView(deps) {
|
||||
getManualCorrectionSummary, formatTeamActiveMemberLabel, formatRaceClock, renderSessionChannelAnalysis,
|
||||
setLastFinishAnnouncementSessionId, lastOverlayLeaderKeyBySession, lastOverlayTop3BySession, overlayEvents, setOverlayEvents, sessionReplay,
|
||||
syncTrainingLedger = () => {}, setCompetitorLapStatus = () => false, openJudging = () => {},
|
||||
getLiveSession = () => null, selectLiveSession = () => {},
|
||||
} = deps;
|
||||
|
||||
const helperDeps = {
|
||||
@@ -442,8 +443,12 @@ export function renderTimingView(deps) {
|
||||
if (getSelectedLeaderboardKey() && !selectedRow) {
|
||||
setSelectedLeaderboardKey(null);
|
||||
}
|
||||
// Another session is running while a different one is selected: say where laps go.
|
||||
const liveSession = getLiveSession();
|
||||
const liveElsewhere = liveSession && liveSession.id !== active?.id && ["running", "paused"].includes(liveSession.status) ? liveSession : null;
|
||||
|
||||
dom.view.innerHTML = `
|
||||
${liveElsewhere ? `<div class="live-elsewhere-banner" id="liveElsewhereBanner"><span>⏱ ${escapeHtml(t("timing.live_elsewhere", { name: liveElsewhere.name }))}</span><button class="btn btn-mini" type="button" data-show-live="${escapeHtml(liveElsewhere.id)}">${escapeHtml(t("timing.show_live"))}</button></div>` : ""}
|
||||
<section class="panel">
|
||||
<div class="panel-header"><h3>${t("timing.decoder_connection")}</h3></div>
|
||||
<div class="panel-body timing-top-grid">
|
||||
@@ -780,6 +785,7 @@ export function renderTimingView(deps) {
|
||||
if (session) finishOperationalSession(session);
|
||||
});
|
||||
|
||||
dom.view.querySelector("[data-show-live]")?.addEventListener("click", (event) => selectLiveSession(event.currentTarget.dataset.showLive));
|
||||
// Remove / restore / approve one lap - from the suspect panel or a driver's lap list.
|
||||
dom.view.querySelectorAll("[data-lap-action]").forEach((button) => button.addEventListener("click", () => {
|
||||
const session = getActiveSession();
|
||||
|
||||
Reference in new issue
Block a user