fix: show motion dot regardless of liveReady in grid callback path

The motionVisible condition gated the external dot (via onActiveMotionChange
callback) on liveReady, causing the dot to stay hidden for cameras in
continuous mode (showStillWithoutActivity=false) while the stream is loading
or reconnecting. Since the parent (DraggableGridLayout) renders the dot
outside the stream viewport, it should reflect actual motion state without
depending on stream load status.

Simplify the callback-path effect to use !!(autoLive && !offline &&
activeMotion) so the dot appears in the grid card whenever motion is active.
The full condition (including liveReady) is still used for the inline dot
rendered inside LivePlayer when no callback is provided.

https://claude.ai/code/session_019B4dJXtcxvHn97ZaqHUB62
This commit is contained in:
Claude 2026-03-16 12:05:26 +00:00
parent 3ba0f1e230
commit 81f0164e9c
No known key found for this signature in database

View File

@ -301,15 +301,13 @@ export default function LivePlayer({
onLoadingChangeRef.current?.(loading); onLoadingChangeRef.current?.(loading);
}, [cameraEnabled, offline, showStillWithoutActivity, isReEnabling, liveReady]); }, [cameraEnabled, offline, showStillWithoutActivity, isReEnabling, liveReady]);
// When the parent manages the dot via callback (grid view), show motion
// without gating on liveReady — the dot should reflect actual motion state
// regardless of stream load status to avoid the dot not appearing for
// cameras in continuous mode while the stream is reconnecting.
useEffect(() => { useEffect(() => {
const motionVisible = !!( onActiveMotionChangeRef.current?.(!!(autoLive && !offline && activeMotion));
autoLive && }, [autoLive, offline, activeMotion]);
!offline &&
activeMotion &&
((showStillWithoutActivity && !liveReady) || liveReady)
);
onActiveMotionChangeRef.current?.(motionVisible);
}, [autoLive, offline, activeMotion, showStillWithoutActivity, liveReady]);
if (!cameraConfig) { if (!cameraConfig) {
return <ActivityIndicator />; return <ActivityIndicator />;