Correctly show whether there are new images or not.

find returns 'undefined' not 'null'!
This commit is contained in:
Simon Howe
2017-11-20 14:37:33 +01:00
parent 830cfc964d
commit ef99e672c9

View File

@@ -2,7 +2,6 @@ import React from 'react';
import { connect } from 'react-redux';
import find from 'lodash/find';
import map from 'lodash/map';
import isNull from 'lodash/isNull';
import { CircularProgress } from 'weaveworks-ui-components';
import { getImagesForService } from '../../actions/app-actions';
@@ -14,7 +13,7 @@ function newImagesAvailable(images, currentId) {
if (current) {
const timestamp = new Date(current.CreatedAt);
return !isNull(find(images, i => timestamp < new Date(i.CreatedAt)));
return Boolean(find(images, i => new Date(i.CreatedAt) > timestamp));
}
return false;