Stop displaying 'loading' when empty set of alerts

pull/10616/head
Kevin Fitzpatrick 2016-11-07 11:06:23 -08:00
parent 8fe8de3de1
commit 55a6bfcdda
1 changed files with 4 additions and 0 deletions

View File

@ -51,6 +51,10 @@ const AlertsApp = React.createClass({
const results = [];
const alertSeries = _.get(resp, ['data', 'results', '0', 'series'], []);
if (alertSeries.length === 0) {
this.setState({loading: false, alerts: []});
return;
}
const timeIndex = alertSeries[0].columns.findIndex((col) => col === 'time');
const hostIndex = alertSeries[0].columns.findIndex((col) => col === 'host');