dashboard reload fix

This commit is contained in:
Riley Davis
2017-03-16 11:45:10 -06:00
parent 3277923a8c
commit 39596399ec
@@ -31,16 +31,20 @@ class CountdownTimer extends React.Component {
}
componentWillMount () {
setInterval(() => { // the countdown timer
this.interval = setInterval(() => { // the countdown timer
let nextCount = this.state.secondsUntilRefresh - 1;
if (nextCount < 0) {
nextCount = refreshIntervalSeconds;
this.props.handleTimeout();
return this.props.handleTimeout();
}
this.setState({secondsUntilRefresh: nextCount});
}, 1000);
}
componentWillUnmount () {
window.clearInterval(this.interval);
}
formatTime = () => {
const minutes = Math.floor(this.state.secondsUntilRefresh / 60);
let seconds = (this.state.secondsUntilRefresh % 60).toString();