forked from Github/frigate
Add option for live mode & timezone config, fix MSE check for iPad (#5079)
* Add config fields * Clean up camera default values * Set recordings timezone with config if available * Adjust for timezone config * Cleanup setting of the timezone * Don't fail on MSE check iPad * Fix MSE check for birdseye * Add docs * Fix test
This commit is contained in:
@@ -9,7 +9,8 @@ import { useApiHost } from '../api';
|
||||
import useSWR from 'swr';
|
||||
|
||||
export default function Recording({ camera, date, hour = '00', minute = '00', second = '00' }) {
|
||||
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
||||
const { data: config } = useSWR('config');
|
||||
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]
|
||||
@@ -113,10 +114,14 @@ export default function Recording({ camera, date, hour = '00', minute = '00', se
|
||||
}
|
||||
}, [seekSeconds, playlistIndex]);
|
||||
|
||||
if (!recordingsSummary || !recordings) {
|
||||
if (!recordingsSummary || !recordings || !config) {
|
||||
return <ActivityIndicator />;
|
||||
}
|
||||
|
||||
if (config.ui.timezone) {
|
||||
timezone = config.ui.timezone;
|
||||
}
|
||||
|
||||
if (recordingsSummary.length === 0) {
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
|
||||
Reference in New Issue
Block a user