Revert "fix: motion dot outside zoom transform, fix activeMotion logic"

This commit is contained in:
ibs0d 2026-03-18 20:08:04 +11:00 committed by GitHub
parent f99ef4075a
commit 301dfc185b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 6 deletions

View File

@ -176,7 +176,9 @@ export function useCameraActivity(
enabled: isCameraEnabled,
activeTracking: isCameraEnabled ? hasActiveObjects : false,
activeMotion: isCameraEnabled
? updatedCameraState?.motion === true || detectingMotion === "ON"
? detectingMotion
? detectingMotion === "ON"
: updatedCameraState?.motion === true
: false,
objects: isCameraEnabled ? (objects ?? []) : [],
audio_detections: isCameraEnabled ? (audioDetections ?? []) : [],

View File

@ -32,8 +32,6 @@ import { PlayerStats } from "@/components/player/PlayerStats";
import { MdCircle } from "react-icons/md";
import { useCameraActivity } from "@/hooks/use-camera-activity";
import { Skeleton } from "@/components/ui/skeleton";
import { MdCircle } from "react-icons/md";
import { useCameraActivity } from "@/hooks/use-camera-activity";
import { isEqual } from "lodash";
import useSWR from "swr";
@ -1083,8 +1081,9 @@ const BirdseyeLivePlayerGridItem = React.forwardRef<
},
);
// Separate component so useCameraActivity can be called as a hook (no hooks in loops).
// Rendered outside the zoom transform div so it doesn't scale with the camera zoom.
// Separate component so it can call useCameraActivity as a hook (no hooks in loops).
// Direct WS subscription guarantees the dot reacts to motion changes in real-time
// without relying on an intermediate callback → parent-state chain.
function CameraMotionDot({
camera,
autoLive,
@ -1096,7 +1095,7 @@ function CameraMotionDot({
if (autoLive === false || offline || !activeMotion) return null;
return (
<div className="absolute right-2 top-2 z-40">
<MdCircle className="size-2 animate-pulse text-danger drop-shadow-md" />
<MdCircle className="mr-2 size-2 animate-pulse text-danger shadow-danger drop-shadow-md" />
</div>
);
}