From 55a6bfcdda3f571d0dc43034105be913a19185ff Mon Sep 17 00:00:00 2001 From: Kevin Fitzpatrick Date: Mon, 7 Nov 2016 11:06:23 -0800 Subject: [PATCH] Stop displaying 'loading' when empty set of alerts --- ui/src/alerts/containers/AlertsApp.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/src/alerts/containers/AlertsApp.js b/ui/src/alerts/containers/AlertsApp.js index b039736447..a8a613ebf6 100644 --- a/ui/src/alerts/containers/AlertsApp.js +++ b/ui/src/alerts/containers/AlertsApp.js @@ -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');