Fix timer not showing
This commit is contained in:
parent
5c27eccf3d
commit
2243d3e7dd
|
|
@ -141,12 +141,7 @@ class Main extends React.Component {
|
||||||
updateTimerEnd() {
|
updateTimerEnd() {
|
||||||
const tournamentId = this.props.query.code;
|
const tournamentId = this.props.query.code;
|
||||||
getTournamentTimerEnd(tournamentId, (status, timerEnd) => {
|
getTournamentTimerEnd(tournamentId, (status, timerEnd) => {
|
||||||
const now = new Date();
|
this.setState({timerEnd: timerEnd});
|
||||||
if (timerEnd > now) {
|
|
||||||
this.setState({timerEnd: timerEnd});
|
|
||||||
} else {
|
|
||||||
this.setState({timerEnd: null});
|
|
||||||
}
|
|
||||||
}, error => {
|
}, error => {
|
||||||
console.error('Failed to fetch timer end:', error);
|
console.error('Failed to fetch timer end:', error);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue