diff --git a/client/src/App.js b/client/src/App.js index ac22638..6c79e36 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -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) {