From 7d3b481181f6efa121dec13e656e9eb46814e269 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Sat, 30 Mar 2024 10:51:03 -0500 Subject: [PATCH] fix missing collapsed prop after refactor (#10751) --- web/src/components/timeline/MotionReviewTimeline.tsx | 1 + web/src/components/timeline/ReviewTimeline.tsx | 3 +++ web/src/hooks/use-camera-activity.ts | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/web/src/components/timeline/MotionReviewTimeline.tsx b/web/src/components/timeline/MotionReviewTimeline.tsx index 8f4e4b51d..43d5f324d 100644 --- a/web/src/components/timeline/MotionReviewTimeline.tsx +++ b/web/src/components/timeline/MotionReviewTimeline.tsx @@ -185,6 +185,7 @@ export function MotionReviewTimeline({ exportEndTime={exportEndTime} setExportStartTime={setExportStartTime} setExportEndTime={setExportEndTime} + timelineCollapsed={motionOnly} dense={dense} > {segments} diff --git a/web/src/components/timeline/ReviewTimeline.tsx b/web/src/components/timeline/ReviewTimeline.tsx index 49568c82e..6a686c8e5 100644 --- a/web/src/components/timeline/ReviewTimeline.tsx +++ b/web/src/components/timeline/ReviewTimeline.tsx @@ -28,6 +28,7 @@ export type ReviewTimelineProps = { exportEndTime?: number; setExportStartTime?: React.Dispatch>; setExportEndTime?: React.Dispatch>; + timelineCollapsed?: boolean; dense: boolean; children: ReactNode; }; @@ -48,6 +49,7 @@ export function ReviewTimeline({ setExportStartTime, exportEndTime, setExportEndTime, + timelineCollapsed = false, dense, children, }: ReviewTimelineProps) { @@ -105,6 +107,7 @@ export function ReviewTimeline({ setDraggableElementTime: setHandlebarTime, initialScrollIntoViewOnly: onlyInitialHandlebarScroll, timelineDuration, + timelineCollapsed: timelineCollapsed, timelineStartAligned, isDragging: isDraggingHandlebar, setIsDragging: setIsDraggingHandlebar, diff --git a/web/src/hooks/use-camera-activity.ts b/web/src/hooks/use-camera-activity.ts index d8cb3c506..9b295f327 100644 --- a/web/src/hooks/use-camera-activity.ts +++ b/web/src/hooks/use-camera-activity.ts @@ -82,7 +82,7 @@ export function useCameraMotionNextTimestamp( }); const noMotionRanges = useMemo(() => { - if (!motionData || !reviewItems || !motionData) { + if (!motionData?.length || !reviewItems) { return; }