mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Error message and search reset for explore pane (#14534)
This commit is contained in:
parent
7afc1e9762
commit
8bc145472a
@ -18,6 +18,7 @@ import { isMobileOnly } from "react-device-detect";
|
||||
import { LuCheck, LuExternalLink, LuX } from "react-icons/lu";
|
||||
import { TbExclamationCircle } from "react-icons/tb";
|
||||
import { Link } from "react-router-dom";
|
||||
import { toast } from "sonner";
|
||||
import useSWR from "swr";
|
||||
import useSWRInfinite from "swr/infinite";
|
||||
|
||||
@ -180,6 +181,18 @@ export default function Explore() {
|
||||
revalidateFirstPage: true,
|
||||
revalidateOnFocus: true,
|
||||
revalidateAll: false,
|
||||
onError: (error) => {
|
||||
toast.error(
|
||||
`Error fetching tracked objects: ${error.response.data.message}`,
|
||||
{
|
||||
position: "top-center",
|
||||
},
|
||||
);
|
||||
if (error.response.status === 404) {
|
||||
// reset all filters if 404
|
||||
setSearchFilter({});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
const searchResults = useMemo(
|
||||
|
Loading…
Reference in New Issue
Block a user