diff --git a/src/client/components/EventDetail.tsx b/src/client/components/EventDetail.tsx index 3886aa5..3c53703 100644 --- a/src/client/components/EventDetail.tsx +++ b/src/client/components/EventDetail.tsx @@ -86,6 +86,9 @@ export function EventDetail({ const game = gameMeta(event.game); const heat = URGENCY_COLOR[clock.urgency]; const risk = status === "done" ? "fine" : pressure(effort, clock.msRemaining); + // Read once rather than at both the guard and the render: calling it twice + // was what forced the non-null assertion below it. + const cadence = cadenceLabel(own?.record.repeat ?? null); useEffect(() => { const onKey = (e: KeyboardEvent) => { @@ -160,8 +163,8 @@ export function EventDetail({ {event.type} - {cadenceLabel(own?.record.repeat ?? null) !== null && ( -

{cadenceLabel(own!.record.repeat)}

+ {cadence !== null && ( +

{cadence}

)} {risk !== "fine" && effort !== undefined && clock.msRemaining !== null && (