Simplify live image update logic

This commit is contained in:
Nicolas Mowen 2024-05-27 07:24:50 -06:00
parent be147d218b
commit 596a11f479

View File

@ -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 <ActivityIndicator />;