diff --git a/web/src/views/events/EventView.tsx b/web/src/views/events/EventView.tsx index 8a12ec347..02e34f0d4 100644 --- a/web/src/views/events/EventView.tsx +++ b/web/src/views/events/EventView.tsx @@ -42,6 +42,7 @@ import VideoControls from "@/components/player/VideoControls"; import { TimeRange } from "@/types/timeline"; import { useCameraMotionNextTimestamp } from "@/hooks/use-camera-activity"; import useOptimisticState from "@/hooks/use-optimistic-state"; +import { Skeleton } from "@/components/ui/skeleton"; type EventViewProps = { reviews?: ReviewSegment[]; @@ -837,25 +838,29 @@ function MotionReview({ const detectionType = getDetectionType(camera.name); return (
- { - videoPlayersRef.current[camera.name] = controller; - }} - onClick={() => - onOpenRecording({ - camera: camera.name, - startTime: Math.min(currentTime, Date.now() / 1000 - 10), - severity: "significant_motion", - }) - } - /> + {motionData ? ( + { + videoPlayersRef.current[camera.name] = controller; + }} + onClick={() => + onOpenRecording({ + camera: camera.name, + startTime: currentTime, + severity: "significant_motion", + }) + } + /> + ) : ( + + )}
@@ -865,28 +870,32 @@ function MotionReview({
- { - if (playing && scrubbing) { - setPlaying(false); - } + {motionData ? ( + { + if (playing && scrubbing) { + setPlaying(false); + } - setScrubbing(scrubbing); - }} - dense={isMobile} - /> + setScrubbing(scrubbing); + }} + dense={isMobile} + /> + ) : ( + + )}