| 628 | } |
| 629 | |
| 630 | componentDidMount() { |
| 631 | const app = this; |
| 632 | if (BURNED_IN_MODEL_INFO !== null) { |
| 633 | app.setState({model: BURNED_IN_MODEL_INFO}); |
| 634 | } else { |
| 635 | fetch("./model_info.json").then(function(response) { |
| 636 | if (!response.ok) { |
| 637 | throw new Error("Response not ok."); |
| 638 | } |
| 639 | return response.json(); |
| 640 | }).then(function(body) { |
| 641 | app.setState({model: body}); |
| 642 | }).catch(function(error) { |
| 643 | console.log("Top-level error: ", error); |
| 644 | }); |
| 645 | } |
| 646 | } |
| 647 | |
| 648 | componentDidCatch(error) { |
| 649 | void(error); |