Remove countdown on Lists

This commit is contained in:
saltrafael 2021-08-24 07:03:13 -03:00 committed by zeppi
parent 1124125578
commit 15aee9eb4e

View file

@ -88,26 +88,30 @@ function AutoplayCountdown(props: Props) {
// Update countdown timer. // Update countdown timer.
React.useEffect(() => { React.useEffect(() => {
let interval; if (collectionId) {
if (!timerCanceled && nextRecommendedUri) { doNavigate();
if (isTimerPaused) { } else {
clearInterval(interval); let interval;
setTimer(countdownTime); if (!timerCanceled && nextRecommendedUri) {
} else { if (isTimerPaused) {
interval = setInterval(() => { clearInterval(interval);
const newTime = timer - 1; setTimer(countdownTime);
if (newTime === 0) { } else {
doNavigate(); interval = setInterval(() => {
} else { const newTime = timer - 1;
setTimer(timer - 1); if (newTime === 0) {
} doNavigate();
}, 1000); } else {
setTimer(timer - 1);
}
}, 1000);
}
} }
return () => {
clearInterval(interval);
};
} }
return () => { }, [timer, doNavigate, navigateUrl, push, timerCanceled, isTimerPaused, nextRecommendedUri, collectionId]);
clearInterval(interval);
};
}, [timer, doNavigate, navigateUrl, push, timerCanceled, isTimerPaused, nextRecommendedUri]);
if (timerCanceled || !nextRecommendedUri) { if (timerCanceled || !nextRecommendedUri) {
return null; return null;