diff --git a/ui/component/autoplayCountdown/view.jsx b/ui/component/autoplayCountdown/view.jsx index 938f32851..f1fd4b78f 100644 --- a/ui/component/autoplayCountdown/view.jsx +++ b/ui/component/autoplayCountdown/view.jsx @@ -15,8 +15,11 @@ type Props = { nextRecommendedClaim: ?StreamClaim, nextRecommendedUri: string, modal: { id: string, modalProps: {} }, + skipPaid: boolean, doNavigate: () => void, doReplay: () => void, + doPrevious: () => void, + onCanceled: () => void, }; function AutoplayCountdown(props: Props) { @@ -25,8 +28,11 @@ function AutoplayCountdown(props: Props) { nextRecommendedClaim, history: { push }, modal, + skipPaid, doNavigate, doReplay, + doPrevious, + onCanceled, } = props; const nextTitle = nextRecommendedClaim && nextRecommendedClaim.value && nextRecommendedClaim.value.title; @@ -68,6 +74,7 @@ function AutoplayCountdown(props: Props) { interval = setInterval(() => { const newTime = timer - 1; if (newTime === 0) { + if (skipPaid) setTimer(countdownTime); doNavigate(); } else { setTimer(timer - 1); @@ -78,7 +85,7 @@ function AutoplayCountdown(props: Props) { return () => { clearInterval(interval); }; - }, [timer, doNavigate, push, timerCanceled, isTimerPaused, nextRecommendedUri]); + }, [timer, doNavigate, push, timerCanceled, isTimerPaused, nextRecommendedUri, skipPaid]); if (timerCanceled || !nextRecommendedUri) { return null; @@ -105,19 +112,41 @@ function AutoplayCountdown(props: Props) { )} {!isTimerPaused && (
- {__('Playing in %seconds_left% seconds...', { seconds_left: timer })}{' '} -
)} -