mirror of
https://github.com/henrywhitaker3/Speedtest-Tracker.git
synced 2025-12-24 06:28:27 +01:00
Fix issue where the data would refresh before the react state had updated
This commit is contained in:
3
resources/js/components/Home/HomePage.js
vendored
3
resources/js/components/Home/HomePage.js
vendored
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user