Another white screen fix

This commit is contained in:
VakarisZ 2019-10-31 10:48:02 +02:00
parent ac63797f45
commit 1f5acbc287
1 changed files with 16 additions and 12 deletions

View File

@ -43,11 +43,13 @@ class MapPageComponent extends AuthComponent {
this.authFetch('/api/netmap')
.then(res => res.json())
.then(res => {
if (res.hasOwnProperty("edges")) {
res.edges.forEach(edge => {
edge.color = {'color': edgeGroupToColor(edge.group)};
});
this.setState({graph: res});
this.props.onStatusChange();
}
});
};
@ -55,6 +57,7 @@ class MapPageComponent extends AuthComponent {
this.authFetch('/api/telemetry-feed?timestamp='+this.state.telemetryLastTimestamp)
.then(res => res.json())
.then(res => {
if ('telemetries' in res) {
let newTelem = this.state.telemetry.concat(res['telemetries']);
this.setState(
@ -63,6 +66,7 @@ class MapPageComponent extends AuthComponent {
telemetryLastTimestamp: res['timestamp']
});
this.props.onStatusChange();
}
});
};