mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-08-08 13:51:01 +02:00
Ensure arrayKeys remains a stable array reference
fixes infinite loop and react crash from changes in #19406
This commit is contained in:
parent
49793aa655
commit
b1d6de2370
@ -26,6 +26,15 @@ import { useDocDomain } from "@/hooks/use-doc-domain";
|
||||
|
||||
const API_LIMIT = 25;
|
||||
|
||||
// always parse these as string arrays
|
||||
const SEARCH_FILTER_ARRAY_KEYS = [
|
||||
"cameras",
|
||||
"labels",
|
||||
"sub_labels",
|
||||
"recognized_license_plate",
|
||||
"zones",
|
||||
];
|
||||
|
||||
export default function Explore() {
|
||||
// search field handler
|
||||
|
||||
@ -58,13 +67,7 @@ export default function Explore() {
|
||||
const [search, setSearch] = useState("");
|
||||
|
||||
const [searchFilter, setSearchFilter, searchSearchParams] =
|
||||
useApiFilterArgs<SearchFilter>([
|
||||
"cameras",
|
||||
"labels",
|
||||
"sub_labels",
|
||||
"recognized_license_plate",
|
||||
"zones",
|
||||
]);
|
||||
useApiFilterArgs<SearchFilter>(SEARCH_FILTER_ARRAY_KEYS);
|
||||
|
||||
const searchTerm = useMemo(
|
||||
() => searchSearchParams?.["query"] || "",
|
||||
|
Loading…
Reference in New Issue
Block a user