|
@@ -130,12 +130,16 @@ 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);
|
|
|
- }
|
|
|
+ // 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])
|