NVR with realtime local object detection for IP cameras
TypeScript aicameragoogle-coralhome-assistanthome-automationhomeautomationmqttnvrobject-detectionrealtimertsptensorflow
Fix timeline overlay for in progress events (#8852)
Nicolas Mowenebcf25741b54
diff --git a/web/src/components/TimelineSummary.jsx b/web/src/components/TimelineSummary.jsxindex b3f32c3af8..89b8914c3f 100644--- a/web/src/components/TimelineSummary.jsx+++ b/web/src/components/TimelineSummary.jsx@@ -34,10 +34,18 @@ export default function TimelineSummary({ event, onFrameSelected }) {const [timeIndex, setTimeIndex] = useState(-1);- const recordingParams = {- before: event.end_time || Date.now(),- after: event.start_time,- };+ const recordingParams = useMemo(() => {+ if (!event.end_time) {+ return {+ after: event.start_time,+ };+ }++ return {+ before: event.end_time,+ after: event.start_time,+ };+ }, [event]);const { data: recordings } = useSWR([`${event.camera}/recordings`, recordingParams], { revalidateOnFocus: false });// calculates the seek seconds by adding up all the seconds in the segments prior to the playback time