mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-12-23 19:11:14 +01:00
Fix timeline overlay for in progress events (#8852)
This commit is contained in:
parent
eed08f534f
commit
ebcf25741b
@ -34,10 +34,18 @@ export default function TimelineSummary({ event, onFrameSelected }) {
|
|||||||
|
|
||||||
const [timeIndex, setTimeIndex] = useState(-1);
|
const [timeIndex, setTimeIndex] = useState(-1);
|
||||||
|
|
||||||
const recordingParams = {
|
const recordingParams = useMemo(() => {
|
||||||
before: event.end_time || Date.now(),
|
if (!event.end_time) {
|
||||||
after: event.start_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 });
|
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
|
// calculates the seek seconds by adding up all the seconds in the segments prior to the playback time
|
||||||
|
Loading…
Reference in New Issue
Block a user