NVR with realtime local object detection for IP cameras
TypeScript aicameragoogle-coralhome-assistanthome-automationhomeautomationmqttnvrobject-detectionrealtimertsptensorflow
Ensure time range filter retains selected values (#17147)
Josh Hawkinsfe078666c62a
diff --git a/web/src/components/overlay/dialog/SearchFilterDialog.tsx b/web/src/components/overlay/dialog/SearchFilterDialog.tsxindex 2768f88591..7fadc1dac2 100644--- a/web/src/components/overlay/dialog/SearchFilterDialog.tsx+++ b/web/src/components/overlay/dialog/SearchFilterDialog.tsx@@ -254,11 +254,13 @@ function TimeRangeFilterContent({const [endOpen, setEndOpen] = useState(false);const [afterHour, beforeHour] = useMemo(() => {- if (!timeRange || !timeRange.includes(",")) {- return [DEFAULT_TIME_RANGE_AFTER, DEFAULT_TIME_RANGE_BEFORE];+ if (Array.isArray(timeRange) && timeRange.length === 2) {+ return timeRange;}-- return timeRange.split(",");+ if (typeof timeRange === "string" && timeRange.includes(",")) {+ return timeRange.split(",");+ }+ return [DEFAULT_TIME_RANGE_AFTER, DEFAULT_TIME_RANGE_BEFORE];}, [timeRange]);const [selectedAfterHour, setSelectedAfterHour] = useState(afterHour);