Skip to content

Commit

Permalink
Ensure that the start time is within the time range
Browse files Browse the repository at this point in the history
  • Loading branch information
NickM-27 committed Aug 12, 2024
1 parent d7fae79 commit 5beb6a7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion web/src/views/events/RecordingView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ export function RecordingView({
const previewRowRef = useRef<HTMLDivElement | null>(null);
const previewRefs = useRef<{ [camera: string]: PreviewController }>({});

const [playbackStart, setPlaybackStart] = useState(startTime);
const [playbackStart, setPlaybackStart] = useState(
startTime >= timeRange.after && startTime <= timeRange.before
? startTime
: timeRange.before - 60,
);

const mainCameraReviewItems = useMemo(
() => reviewItems?.filter((cam) => cam.camera == mainCamera) ?? [],
Expand Down

0 comments on commit 5beb6a7

Please sign in to comment.