From b80080ac52df35ee6934f76722b265178a7cafb6 Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Thu, 7 Jul 2022 07:05:05 -0500 Subject: [PATCH] don't refetch data on refocus --- web/src/routes/Recording.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/routes/Recording.jsx b/web/src/routes/Recording.jsx index e0b704d36..1f592d469 100644 --- a/web/src/routes/Recording.jsx +++ b/web/src/routes/Recording.jsx @@ -15,13 +15,13 @@ export default function Recording({ camera, date, hour = '00', minute = '00', se ); const apiHost = useApiHost(); - const { data: recordingsSummary } = useSWR(`${camera}/recordings/summary`); + const { data: recordingsSummary } = useSWR(`${camera}/recordings/summary`, { revalidateOnFocus: false }); const recordingParams = { before: getUnixTime(endOfHour(currentDate)), after: getUnixTime(startOfHour(currentDate)), }; - const { data: recordings } = useSWR([`${camera}/recordings`, recordingParams]); + const { data: recordings } = useSWR([`${camera}/recordings`, recordingParams], { revalidateOnFocus: false }); // calculates the seek seconds by adding up all the seconds in the segments prior to the playback time const seekSeconds = useMemo(() => {