mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-09-28 10:56:52 +03:00
remember last selected history sidebar tab (#24488)
CI / AMD64 Build (push) Waiting to run
CI / AMD64 Smoke Test (push) Blocked by required conditions
CI / ARM Build (push) Waiting to run
CI / Jetson Jetpack 6 (push) Waiting to run
CI / AMD64 Extra Build (push) Blocked by required conditions
CI / ARM Extra Build (push) Blocked by required conditions
CI / Synaptics Build (push) Blocked by required conditions
CI / Assemble and push default build (push) Blocked by required conditions
CI / AMD64 Build (push) Waiting to run
CI / AMD64 Smoke Test (push) Blocked by required conditions
CI / ARM Build (push) Waiting to run
CI / Jetson Jetpack 6 (push) Waiting to run
CI / AMD64 Extra Build (push) Blocked by required conditions
CI / ARM Extra Build (push) Blocked by required conditions
CI / Synaptics Build (push) Blocked by required conditions
CI / Assemble and push default build (push) Blocked by required conditions
The History view always opened on Timeline unless the link carried a tab. The selected tab is now saved with useUserPersistence and used as the default when no tab is passed. Notification and shared review links no longer default to "timeline", so they pick up the saved tab too, and `?tab=` still overrides it.
This commit is contained in:
@@ -132,8 +132,7 @@ export default function Events() {
|
||||
setMotionSearchDay(normalizedDay);
|
||||
}, []);
|
||||
|
||||
const [notificationTab, setNotificationTab] =
|
||||
useState<TimelineType>("timeline");
|
||||
const [notificationTab, setNotificationTab] = useState<TimelineType>();
|
||||
|
||||
const getReviewDayBounds = useCallback((date: Date) => {
|
||||
const now = Date.now() / 1000;
|
||||
|
||||
@@ -14,6 +14,7 @@ import { Button } from "@/components/ui/button";
|
||||
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
|
||||
import { useOverlayState } from "@/hooks/use-overlay-state";
|
||||
import { usePersistence } from "@/hooks/use-persistence";
|
||||
import { useUserPersistence } from "@/hooks/use-user-persistence";
|
||||
import { useResizeObserver } from "@/hooks/resize-observer";
|
||||
import { DEFAULT_DRAWER_FEATURES, ExportMode } from "@/types/filter";
|
||||
import { FrigateConfig } from "@/types/frigateConfig";
|
||||
@@ -182,9 +183,19 @@ export function RecordingView({
|
||||
false,
|
||||
);
|
||||
|
||||
const [timelineType, setTimelineType] = useOverlayState<TimelineType>(
|
||||
const [savedTimelineType, setSavedTimelineType] =
|
||||
useUserPersistence<TimelineType>("recordingTimelineType");
|
||||
const [timelineType, setOverlayTimelineType] = useOverlayState<TimelineType>(
|
||||
"timelineType",
|
||||
recording?.timelineType ?? "timeline",
|
||||
recording?.timelineType ?? savedTimelineType ?? "timeline",
|
||||
);
|
||||
|
||||
const setTimelineType = useCallback(
|
||||
(value: TimelineType, replace?: boolean) => {
|
||||
setOverlayTimelineType(value, replace);
|
||||
setSavedTimelineType(value);
|
||||
},
|
||||
[setOverlayTimelineType, setSavedTimelineType],
|
||||
);
|
||||
|
||||
const chunkedTimeRange = useMemo(
|
||||
|
||||
Reference in New Issue
Block a user