mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-07-30 13:48:07 +02:00
Fixes (#15465)
* Fix single event return * Allow customizing if search is preserved for overlay state * Remove timeout * Cleanup * Cleanup naming
This commit is contained in:
parent
53b96dfb89
commit
b4d82084a9
@ -256,8 +256,9 @@ class EventCleanup(threading.Thread):
|
|||||||
|
|
||||||
events_to_update = []
|
events_to_update = []
|
||||||
|
|
||||||
for batch in query.iterator():
|
for event in query.iterator():
|
||||||
events_to_update.extend([event.id for event in batch])
|
events_to_update.append(event)
|
||||||
|
|
||||||
if len(events_to_update) >= CHUNK_SIZE:
|
if len(events_to_update) >= CHUNK_SIZE:
|
||||||
logger.debug(
|
logger.debug(
|
||||||
f"Updating {update_params} for {len(events_to_update)} events"
|
f"Updating {update_params} for {len(events_to_update)} events"
|
||||||
|
@ -5,6 +5,7 @@ import { usePersistence } from "./use-persistence";
|
|||||||
export function useOverlayState<S>(
|
export function useOverlayState<S>(
|
||||||
key: string,
|
key: string,
|
||||||
defaultValue: S | undefined = undefined,
|
defaultValue: S | undefined = undefined,
|
||||||
|
preserveSearch: boolean = true,
|
||||||
): [S | undefined, (value: S, replace?: boolean) => void] {
|
): [S | undefined, (value: S, replace?: boolean) => void] {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
@ -15,7 +16,7 @@ export function useOverlayState<S>(
|
|||||||
(value: S, replace: boolean = false) => {
|
(value: S, replace: boolean = false) => {
|
||||||
const newLocationState = { ...currentLocationState };
|
const newLocationState = { ...currentLocationState };
|
||||||
newLocationState[key] = value;
|
newLocationState[key] = value;
|
||||||
navigate(location.pathname + location.search, {
|
navigate(location.pathname + (preserveSearch ? location.search : ""), {
|
||||||
state: newLocationState,
|
state: newLocationState,
|
||||||
replace,
|
replace,
|
||||||
});
|
});
|
||||||
|
@ -39,8 +39,11 @@ export default function Events() {
|
|||||||
|
|
||||||
const [showReviewed, setShowReviewed] = usePersistence("showReviewed", false);
|
const [showReviewed, setShowReviewed] = usePersistence("showReviewed", false);
|
||||||
|
|
||||||
const [recording, setRecording] =
|
const [recording, setRecording] = useOverlayState<RecordingStartingPoint>(
|
||||||
useOverlayState<RecordingStartingPoint>("recording");
|
"recording",
|
||||||
|
undefined,
|
||||||
|
false,
|
||||||
|
);
|
||||||
|
|
||||||
useSearchEffect("id", (reviewId: string) => {
|
useSearchEffect("id", (reviewId: string) => {
|
||||||
axios
|
axios
|
||||||
|
Loading…
Reference in New Issue
Block a user