Remove countdown on Lists
This commit is contained in:
parent
1124125578
commit
15aee9eb4e
1 changed files with 22 additions and 18 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue