Check if camera is active before disabling liveReady (#12461)

This commit is contained in:
Josh Hawkins
2024-07-15 16:52:34 -05:00
committed by GitHub
parent b7cf5f4105
commit 5c90f7dce7

View File

@@ -79,7 +79,15 @@ export default function LivePlayer({
}
if (!cameraActive) {
setTimeout(() => setLiveReady(false), 500);
const timer = setTimeout(() => {
if (!cameraActive) {
setLiveReady(false);
}
}, 500);
return () => {
clearTimeout(timer);
};
}
// live mode won't change
// eslint-disable-next-line react-hooks/exhaustive-deps