From 9630565aee7d06be52c9f3745728175b1d5e7e30 Mon Sep 17 00:00:00 2001 From: Dylan De Faoite Date: Sun, 2 Aug 2026 17:18:52 +0100 Subject: [PATCH] fix incorrect var name --- frontend/src/pages/Home.tsx | 13 +++++++------ frontend/src/pages/StreamControl.tsx | 8 ++------ frontend/src/utils/types.ts | 2 +- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/frontend/src/pages/Home.tsx b/frontend/src/pages/Home.tsx index 60a8e39..320d0b2 100644 --- a/frontend/src/pages/Home.tsx +++ b/frontend/src/pages/Home.tsx @@ -109,7 +109,9 @@ const Home = () => { // Fetch Markers & Stream information useEffect(() => { getCurrentStream() - .then(setStreamStatus) + .then(data => { + setStreamStatus(data); + }); getMarkers() .then(data => { @@ -152,12 +154,12 @@ const Home = () => { }; useEffect(() => { - if (streamStatus?.startDate == null) { + if (streamStatus?.startTime == null) { setElapsed('00:00:00'); return; } - const startMs = new Date(streamStatus?.startDate).getTime(); + const startMs = new Date(streamStatus?.startTime).getTime(); const tick = () => { const diffSec = Math.floor((Date.now() - startMs) / 1000); @@ -170,7 +172,7 @@ const Home = () => { tick(); const interval = setInterval(tick, 1000); return () => clearInterval(interval); - }, [streamStatus?.startDate]); + }, [streamStatus?.startTime]); if (user == null) { return () @@ -189,7 +191,6 @@ const Home = () => { - {/* Live status — always present, so the page has the same shape either way. */}
{isStreaming @@ -209,7 +210,7 @@ const Home = () => { <>

Session {String(streamStatus?.id).padStart(5, '0')} {' '} - recording since {getTimeFromISOString(streamStatus?.startDate ?? null)}.

+ recording since {getTimeFromISOString(streamStatus?.startTime ?? null)}.
diff --git a/frontend/src/pages/StreamControl.tsx b/frontend/src/pages/StreamControl.tsx index 7ee9a55..4b3a266 100644 --- a/frontend/src/pages/StreamControl.tsx +++ b/frontend/src/pages/StreamControl.tsx @@ -62,7 +62,7 @@ const StreamControl = () => { const [jobs, setJobs] = useState([]); const isStreaming = streamStatus?.isStreaming ?? false; - const startMs = streamStatus?.startDate ? stringToDate(streamStatus.startDate).getTime() : null; + const startMs = streamStatus?.startTime ? stringToDate(streamStatus.startTime).getTime() : null; const elapsedSeconds = startMs === null ? 0 : Math.max(0, (now - startMs) / 1000); const elapsed = formatTimecode(elapsedSeconds); @@ -127,12 +127,10 @@ const StreamControl = () => { const offsetOf = (marker: Marker) => startMs === null ? 0 : (stringToDate(marker.timestamp).getTime() - startMs) / 1000; - // Ticking two markers fills the range. Done here rather than in an effect so a - // marker poll can't stomp on timecodes the user has since typed over. + const toggleMarker = (id: number) => { const next = selected.includes(id) ? selected.filter((current) => current !== id) - // Third tick replaces the older of the two. : selected.length < 2 ? [...selected, id] : [selected[1], id]; setSelected(next); @@ -173,8 +171,6 @@ const StreamControl = () => { setMarkerBusy(true); setMarkerError(null); try { - // Dropping first and naming later isn't possible — markers have no PATCH — - // so an unnamed marker keeps the timecode it landed on. await createMarker(markerMessage.trim() || `Marker at ${elapsed}`); setMarkerMessage(""); refreshMarkers(); diff --git a/frontend/src/utils/types.ts b/frontend/src/utils/types.ts index bd26448..7f781f3 100644 --- a/frontend/src/utils/types.ts +++ b/frontend/src/utils/types.ts @@ -65,7 +65,7 @@ type JobResponse = { type StreamStatus = { isStreaming: boolean, id: number | null, - startDate: string | null + startTime: string | null } type StreamHistoryItem = {