Check if camera is active before disabling liveReady

This commit is contained in:
Josh Hawkins 2024-07-15 16:27:13 -05:00
parent c850604931
commit 57ca841731

View File

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