From 596a11f479e19c09d5529f2a9cd03b45cc0bcc3e Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Mon, 27 May 2024 07:24:50 -0600 Subject: [PATCH] Simplify live image update logic --- web/src/components/player/LivePlayer.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/src/components/player/LivePlayer.tsx b/web/src/components/player/LivePlayer.tsx index a57c697d4..2939e9323 100644 --- a/web/src/components/player/LivePlayer.tsx +++ b/web/src/components/player/LivePlayer.tsx @@ -80,7 +80,7 @@ export default function LivePlayer({ // camera still state const stillReloadInterval = useMemo(() => { - if (!windowVisible) { + if (!windowVisible || offline) { return -1; // no reason to update the image when the window is not visible } @@ -88,12 +88,12 @@ export default function LivePlayer({ return 60000; } - if (cameraActive) { + if (activeMotion || activeTracking) { return 200; } return 30000; - }, [liveReady, cameraActive, windowVisible]); + }, [liveReady, activeMotion, activeTracking, offline, windowVisible]); if (!cameraConfig) { return ;