use single lookup for motion data (#10778)

This commit is contained in:
Josh Hawkins
2024-04-01 09:57:35 -06:00
committed by GitHub
parent 52f65a4dc4
commit 99878d9eee
2 changed files with 21 additions and 29 deletions
@@ -90,9 +90,13 @@ export function MotionReviewTimeline({
const motionStart = segmentTime;
const motionEnd = motionStart + segmentDuration;
const firstHalfMotionValue = getMotionSegmentValue(motionStart);
const secondHalfMotionValue = getMotionSegmentValue(
motionStart + segmentDuration / 2,
);
const segmentMotion =
getMotionSegmentValue(motionStart) > 0 ||
getMotionSegmentValue(motionStart + segmentDuration / 2) > 0;
firstHalfMotionValue > 0 || secondHalfMotionValue > 0;
const overlappingReviewItems = events.some(
(item) =>
(item.start_time >= motionStart && item.start_time < motionEnd) ||
@@ -110,7 +114,8 @@ export function MotionReviewTimeline({
<MotionSegment
key={segmentTime}
events={events}
motion_events={motion_events}
firstHalfMotionValue={firstHalfMotionValue}
secondHalfMotionValue={secondHalfMotionValue}
segmentDuration={segmentDuration}
segmentTime={segmentTime}
timestampSpread={timestampSpread}