|
@@ -130,16 +130,8 @@ const TimerContainer = ({seconds=1800, refresh=100, render:Component}) => {
|
|
|
let [time=seconds*1000, setTime] = useState()
|
|
|
useEffect(() => {
|
|
|
const interval = setInterval(()=> {
|
|
|
- // if(time > 0) {
|
|
|
- // setTime(seconds*1000 - timePassed)
|
|
|
- // setTimePassed(timePassed + refresh)
|
|
|
-
|
|
|
- // } else {
|
|
|
- // return clearInterval(interval);
|
|
|
- // }
|
|
|
time > 0? setTime(seconds*1000 - timePassed) : clearInterval(interval)
|
|
|
setTimePassed(timePassed + refresh)
|
|
|
-
|
|
|
},refresh)
|
|
|
return() => clearInterval(interval)
|
|
|
}, [refresh, time, timePassed, setTimePassed])
|