fix(cp-frontend): poll even when no services (service list)

This commit is contained in:
Sérgio Ramos 2017-08-30 15:06:58 +01:00
parent d9ae6eb34a
commit 94c664fecc

View File

@ -179,18 +179,12 @@ export default compose(
}), }),
withServiceMetricsPolling({ withServiceMetricsPolling({
pollingInterval: 1000, pollingInterval: 1000,
getPreviousEnd: ({ loading, error, services = [] }) => { getPreviousEnd: ({ loading, services = [] }) => {
if (loading) { if (loading) {
return false; return false;
} }
const _services = forceArray(services); const previousEnd = forceArray(services)
if (!_services.length) {
return false;
}
const previousEnd = _services
.map(service => get(service, 'instances[0].metrics[0].end', null)) .map(service => get(service, 'instances[0].metrics[0].end', null))
.filter(Boolean) .filter(Boolean)
.shift(); .shift();