mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-12-19 19:06:16 +01:00
Make all motion segments clickable (#10488)
This commit is contained in:
parent
c14f3c3902
commit
89bd3867a9
@ -39,7 +39,7 @@ export function MotionSegment({
|
||||
shouldShowRoundedCorners,
|
||||
} = useEventSegmentUtils(segmentDuration, events, severityType);
|
||||
|
||||
const { getMotionSegmentValue, interpolateMotionAudioData, getMotionStart } =
|
||||
const { getMotionSegmentValue, interpolateMotionAudioData } =
|
||||
useMotionSegmentUtils(segmentDuration, motion_events);
|
||||
|
||||
const { alignStartDateToTimeline, alignEndDateToTimeline } = useEventUtils(
|
||||
@ -66,15 +66,6 @@ export function MotionSegment({
|
||||
[shouldShowRoundedCorners, segmentTime],
|
||||
);
|
||||
|
||||
const startTimestamp = useMemo(() => {
|
||||
const eventStart = getMotionStart(segmentTime);
|
||||
if (eventStart) {
|
||||
return alignStartDateToTimeline(eventStart);
|
||||
}
|
||||
// we know that these deps are correct
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [getMotionStart, segmentTime]);
|
||||
|
||||
const timestamp = useMemo(() => new Date(segmentTime * 1000), [segmentTime]);
|
||||
const segmentKey = useMemo(() => segmentTime, [segmentTime]);
|
||||
|
||||
@ -179,19 +170,10 @@ export function MotionSegment({
|
||||
};
|
||||
|
||||
const segmentClick = useCallback(() => {
|
||||
if (
|
||||
startTimestamp &&
|
||||
setHandlebarTime &&
|
||||
(firstHalfSegmentWidth > 1 || secondHalfSegmentWidth > 1)
|
||||
) {
|
||||
setHandlebarTime(startTimestamp);
|
||||
if (setHandlebarTime) {
|
||||
setHandlebarTime(segmentTime);
|
||||
}
|
||||
}, [
|
||||
startTimestamp,
|
||||
setHandlebarTime,
|
||||
firstHalfSegmentWidth,
|
||||
secondHalfSegmentWidth,
|
||||
]);
|
||||
}, [segmentTime, setHandlebarTime]);
|
||||
|
||||
return (
|
||||
<div
|
||||
|
Loading…
Reference in New Issue
Block a user