diff --git a/frigate/test/test_http.py b/frigate/test/test_http.py index 4b38f99e0..932a468a3 100644 --- a/frigate/test/test_http.py +++ b/frigate/test/test_http.py @@ -238,7 +238,14 @@ class TestHttp(unittest.TestCase): def test_event_time_filtering(self): app = create_app( - FrigateConfig(**self.minimal_config), self.db, None, None, None + FrigateConfig(**self.minimal_config), + self.db, + None, + None, + None, + None, + None, + PlusApi(), ) morning_id = "123456.random" evening_id = "654321.random" diff --git a/web/src/routes/Events.jsx b/web/src/routes/Events.jsx index f9b9ea24d..7d741dad1 100644 --- a/web/src/routes/Events.jsx +++ b/web/src/routes/Events.jsx @@ -49,7 +49,7 @@ const monthsAgo = (num) => { export default function Events({ path, ...props }) { const apiHost = useApiHost(); const { data: config } = useSWR('config'); - const timezone = useMemo(() => config.ui?.timezone || Intl.DateTimeFormat().resolvedOptions().timeZone, [config]); + const timezone = useMemo(() => config?.ui?.timezone || Intl.DateTimeFormat().resolvedOptions().timeZone, [config]); const [searchParams, setSearchParams] = useState({ before: null, after: null, @@ -100,7 +100,7 @@ export default function Events({ path, ...props }) { params = { ...params, include_thumbnails: 0, limit: API_LIMIT }; return axios.get(path, { params }).then((res) => res.data); }, - [searchParams], + [searchParams] ); const getKey = useCallback( @@ -113,7 +113,7 @@ export default function Events({ path, ...props }) { return ['events', searchParams]; }, - [searchParams], + [searchParams] ); const { data: eventPages, mutate, size, setSize, isValidating } = useSWRInfinite(getKey, eventsFetcher); @@ -136,7 +136,7 @@ export default function Events({ path, ...props }) { labels: Object.values(allLabels || {}), sub_labels: (allSubLabels || []).length > 0 ? [...Object.values(allSubLabels), 'None'] : [], }), - [config, allLabels, allSubLabels], + [config, allLabels, allSubLabels] ); const onSave = async (e, eventId, save) => { @@ -241,14 +241,14 @@ export default function Events({ path, ...props }) { setSearchParams({ ...searchParams, before: dates.before, after: dates.after }); setState({ ...state, showDatePicker: false }); }, - [searchParams, setSearchParams, state, setState], + [searchParams, setSearchParams, state, setState] ); const handleSelectTimeRange = useCallback( (timeRange) => { setSearchParams({ ...searchParams, time_range: timeRange }); }, - [searchParams], + [searchParams] ); const onFilter = useCallback( @@ -266,7 +266,7 @@ export default function Events({ path, ...props }) { .join('&'); route(`${path}?${queryString}`); }, - [path, searchParams, setSearchParams], + [path, searchParams, setSearchParams] ); const isDone = (eventPages?.[eventPages.length - 1]?.length ?? 0) < API_LIMIT; @@ -284,7 +284,7 @@ export default function Events({ path, ...props }) { }); if (node) observer.current.observe(node); }, - [size, setSize, isValidating, isDone], + [size, setSize, isValidating, isDone] ); const onSendToPlus = async (id, false_positive, validBox) => { @@ -307,9 +307,9 @@ export default function Events({ path, ...props }) { return { ...event, plus_id: response.data.plus_id }; } return event; - }), + }) ), - false, + false ); } @@ -415,13 +415,13 @@ export default function Events({ path, ...props }) { downloadEvent.end_time && downloadEvent.has_snapshot && !downloadEvent.plus_id && ( - showSubmitToPlus(downloadEvent.id, downloadEvent.label, downloadEvent.box)} - /> - )} + showSubmitToPlus(downloadEvent.id, downloadEvent.label, downloadEvent.box)} + /> + )} {downloadEvent.plus_id && (