mirror of
https://github.com/wassname/talk.git
synced 2026-07-05 03:21:53 +08:00
Merge branch 'master' into recaptcha-fix
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user