always show timer with one decimal precision (#617)

This commit is contained in:
Knut Hühne 2017-11-22 14:30:36 +01:00 committed by Gregory Schier
parent f82b8f3c1c
commit 1173001e46

View File

@ -21,7 +21,7 @@ class ResponseTimer extends PureComponent {
_handleUpdateElapsedTime () {
const {loadStartTime} = this.props;
const millis = Date.now() - loadStartTime - 200;
const elapsedTime = Math.round(millis / 100) / 10;
const elapsedTime = millis / 1000;
this.setState({elapsedTime});
}
@ -47,7 +47,7 @@ class ResponseTimer extends PureComponent {
return (
<div className={classnames('overlay theme--overlay', {'overlay--hidden': !show})}>
{elapsedTime >= REQUEST_TIME_TO_SHOW_COUNTER
? <h2>{elapsedTime} seconds...</h2>
? <h2>{elapsedTime.toFixed(1)} seconds...</h2>
: <h2>Loading...</h2>
}
<div className="pad">