mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-12 22:25:24 +03:00
Simplify and consider birdseye only group in logic
This commit is contained in:
parent
74b66139d4
commit
d3e508e65e
@ -64,20 +64,31 @@ export default function LiveDashboardView({
|
|||||||
// recent events
|
// recent events
|
||||||
|
|
||||||
const eventUpdate = useFrigateReviews();
|
const eventUpdate = useFrigateReviews();
|
||||||
|
|
||||||
|
const alertCameras = useMemo(() => {
|
||||||
|
if (!config || cameraGroup == "default") {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (includeBirdseye && cameras.length == 0) {
|
||||||
|
return Object.values(config.cameras)
|
||||||
|
.filter((cam) => cam.birdseye.enabled)
|
||||||
|
.map((cam) => cam.name)
|
||||||
|
.join(",");
|
||||||
|
}
|
||||||
|
|
||||||
|
return cameras
|
||||||
|
.map((cam) => cam.name)
|
||||||
|
.filter((cam) => config.camera_groups[cameraGroup].cameras.includes(cam))
|
||||||
|
.join(",");
|
||||||
|
}, [cameras, cameraGroup, config, includeBirdseye]);
|
||||||
|
|
||||||
const { data: allEvents, mutate: updateEvents } = useSWR<ReviewSegment[]>([
|
const { data: allEvents, mutate: updateEvents } = useSWR<ReviewSegment[]>([
|
||||||
"review",
|
"review",
|
||||||
{
|
{
|
||||||
limit: 10,
|
limit: 10,
|
||||||
severity: "alert",
|
severity: "alert",
|
||||||
cameras:
|
cameras: alertCameras,
|
||||||
config == undefined || cameraGroup == "default"
|
|
||||||
? null
|
|
||||||
: cameras
|
|
||||||
.map((cam) => cam.name)
|
|
||||||
.filter((cam) =>
|
|
||||||
config.camera_groups[cameraGroup].cameras.includes(cam),
|
|
||||||
)
|
|
||||||
.join(","),
|
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user