forked from p15670423/monkey
Another white screen fix
This commit is contained in:
parent
ac63797f45
commit
1f5acbc287
|
@ -43,11 +43,13 @@ class MapPageComponent extends AuthComponent {
|
||||||
this.authFetch('/api/netmap')
|
this.authFetch('/api/netmap')
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(res => {
|
.then(res => {
|
||||||
res.edges.forEach(edge => {
|
if (res.hasOwnProperty("edges")) {
|
||||||
edge.color = {'color': edgeGroupToColor(edge.group)};
|
res.edges.forEach(edge => {
|
||||||
});
|
edge.color = {'color': edgeGroupToColor(edge.group)};
|
||||||
this.setState({graph: res});
|
});
|
||||||
this.props.onStatusChange();
|
this.setState({graph: res});
|
||||||
|
this.props.onStatusChange();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -55,14 +57,16 @@ class MapPageComponent extends AuthComponent {
|
||||||
this.authFetch('/api/telemetry-feed?timestamp='+this.state.telemetryLastTimestamp)
|
this.authFetch('/api/telemetry-feed?timestamp='+this.state.telemetryLastTimestamp)
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(res => {
|
.then(res => {
|
||||||
let newTelem = this.state.telemetry.concat(res['telemetries']);
|
if ('telemetries' in res) {
|
||||||
|
let newTelem = this.state.telemetry.concat(res['telemetries']);
|
||||||
|
|
||||||
this.setState(
|
this.setState(
|
||||||
{
|
{
|
||||||
telemetry: newTelem,
|
telemetry: newTelem,
|
||||||
telemetryLastTimestamp: res['timestamp']
|
telemetryLastTimestamp: res['timestamp']
|
||||||
});
|
});
|
||||||
this.props.onStatusChange();
|
this.props.onStatusChange();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue