mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-07-26 13:47:03 +02:00
Ensure time range filter retains selected values (#17147)
This commit is contained in:
parent
fbd22c8124
commit
fe078666c6
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user