fetch latest on generating

This commit is contained in:
Thomas Ruoff
2018-02-01 21:38:08 +01:00
parent 3f72c35d5a
commit 0719cf3947

View File

@@ -9,8 +9,7 @@ import './App.css';
class App extends Component {
componentDidMount() {
getLatest()
.then(latest => this.setState({latest}));
this._getLatest();
}
render() {
@@ -59,7 +58,14 @@ class App extends Component {
pdfError: error.message,
pdfUrl: null
});
});
})
.then(() => this._getLatest())
}
_getLatest() {
getLatest()
.then(latest => this.setState({latest}))
.catch(err => console.error('Unable to get latest:', err));
}
_onChange(name, event) {