Added a button to start the first scan

This commit is contained in:
Henry Whitaker
2020-04-09 16:37:45 +01:00
parent d089ed6724
commit 04bb133f2c
3 changed files with 36 additions and 6 deletions

View File

@@ -37,6 +37,9 @@ export default class LatestResults extends Component {
});
})
.catch((err) => {
this.setState({
data: false
});
console.log(err);
})
}
@@ -64,7 +67,7 @@ export default class LatestResults extends Component {
var loading = this.state.loading;
var data = this.state.data;
if(loading) {
if(loading && data !== false) {
return (
<Container fluid>
<Row>
@@ -74,6 +77,18 @@ export default class LatestResults extends Component {
</Row>
</Container>
);
} else if(data === false) {
return (
<Container fluid>
<Row>
<Col sm={{ span: 12 }} className="text-center">
<div>
<Button variant="primary" onClick={this.newScan}>Start your first scan!</Button>
</div>
</Col>
</Row>
</Container>
);
} else {
return (
<Container fluid>