From f946cf55befb8d1988b44f4314762063add9cd7d Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Mon, 29 Apr 2024 13:20:50 -0600 Subject: [PATCH] Use pre buffer for other links (#11160) --- web/src/components/card/AnimatedEventCard.tsx | 4 ++-- web/src/views/events/RecordingView.tsx | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/web/src/components/card/AnimatedEventCard.tsx b/web/src/components/card/AnimatedEventCard.tsx index dddbcdb77..0ce535518 100644 --- a/web/src/components/card/AnimatedEventCard.tsx +++ b/web/src/components/card/AnimatedEventCard.tsx @@ -3,7 +3,7 @@ import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip"; import { useCallback, useMemo } from "react"; import useSWR from "swr"; import { FrigateConfig } from "@/types/frigateConfig"; -import { ReviewSegment } from "@/types/review"; +import { REVIEW_PADDING, ReviewSegment } from "@/types/review"; import { useNavigate } from "react-router-dom"; import { RecordingStartingPoint } from "@/types/record"; import axios from "axios"; @@ -39,7 +39,7 @@ export function AnimatedEventCard({ event }: AnimatedEventCardProps) { severity: event.severity, recording: { camera: event.camera, - startTime: event.start_time, + startTime: event.start_time - REVIEW_PADDING, severity: event.severity, } as RecordingStartingPoint, }, diff --git a/web/src/views/events/RecordingView.tsx b/web/src/views/events/RecordingView.tsx index 83bcc19ef..d7e4569fa 100644 --- a/web/src/views/events/RecordingView.tsx +++ b/web/src/views/events/RecordingView.tsx @@ -15,6 +15,7 @@ import { FrigateConfig } from "@/types/frigateConfig"; import { Preview } from "@/types/preview"; import { MotionData, + REVIEW_PADDING, ReviewFilter, ReviewSegment, ReviewSummary, @@ -558,7 +559,7 @@ function Timeline({ currentTime={currentTime} onClick={() => { setScrubbing(true); - setCurrentTime(review.start_time); + setCurrentTime(review.start_time - REVIEW_PADDING); setScrubbing(false); }} />