Fix issue where the data would refresh before the react state had updated

This commit is contained in:
Henry Whitaker
2021-09-10 18:16:17 +01:00
parent 9fb573e785
commit 0b1645cda0
4 changed files with 10 additions and 161184 deletions

10940
public/css/app.css vendored

File diff suppressed because one or more lines are too long

150239
public/js/app.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -6,14 +6,14 @@ object-assign
/* @license
Papa Parse
v5.2.0
v5.3.0
https://github.com/mholt/PapaParse
License: MIT
*/
/*!
* Bootstrap v4.5.3 (https://getbootstrap.com/)
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Bootstrap v4.6.0 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
@@ -72,7 +72,7 @@ License: MIT
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
/** @license React v0.19.1
/** @license React v0.20.1
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
@@ -90,7 +90,7 @@ License: MIT
* LICENSE file in the root directory of this source tree.
*/
/** @license React v16.14.0
/** @license React v17.0.1
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
@@ -99,7 +99,7 @@ License: MIT
* LICENSE file in the root directory of this source tree.
*/
/** @license React v16.14.0
/** @license React v17.0.1
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.

View File

@@ -38,10 +38,9 @@ export default class HomePage extends Component {
updateDays = (days) => {
this.setState({ days: days });
this.getData();
this.setState({ days: days }, () => { this.getData() });
}
getData = () => {
axios.get('api/speedtest/home/' + this.state.days)
.then((resp) => {