diff --git a/web/src/routes/Recording.jsx b/web/src/routes/Recording.jsx index b72fbb525..f8fcd5e54 100644 --- a/web/src/routes/Recording.jsx +++ b/web/src/routes/Recording.jsx @@ -10,7 +10,7 @@ import useSWR from 'swr'; export default function Recording({ camera, date, hour = '00', minute = '00', second = '00' }) { const { data: config } = useSWR('config'); - const timezone = config?.ui?.timezone || Intl.DateTimeFormat().resolvedOptions().timeZone; + let timezone = Intl.DateTimeFormat().resolvedOptions().timeZone; const currentDate = useMemo( () => (date ? parseISO(`${date}T${hour || '00'}:${minute || '00'}:${second || '00'}`) : new Date()), [date, hour, minute, second] @@ -114,10 +114,14 @@ export default function Recording({ camera, date, hour = '00', minute = '00', se } }, [seekSeconds, playlistIndex]); - if (!recordingsSummary || !recordings) { + if (!recordingsSummary || !recordings || !config) { return ; } + if (config.ui.timezone) { + timezone = config.ui.timezone; + } + if (recordingsSummary.length === 0) { return (