fix(xo-web/dashboard/overview): missing patches not fetched (#2772)

Fixes #2768
This commit is contained in:
badrAZ 2018-03-16 16:37:57 +01:00 committed by Pierre Donias
parent ca51d59815
commit 89e25c9b81

View File

@ -1,6 +1,6 @@
import React from 'react'
import { Portal } from 'react-overlays'
import { forEach, isEmpty, keys, map, noop } from 'lodash'
import { forEach, isEmpty, keys, map } from 'lodash'
import _ from './intl'
import ActionButton from './action-button'
@ -76,9 +76,6 @@ const ActionButton_ = ({ children, labelId, ...props }) => (
// ===================================================================
@connectStore({
hostsById: createGetObjectsOfType('host').groupBy('id'),
})
class HostsPatchesTable extends Component {
constructor (props) {
super(props)
@ -94,13 +91,8 @@ class HostsPatchesTable extends Component {
)
_subscribeMissingPatches = (hosts = this.props.hosts) => {
const { hostsById } = this.props
const unsubs = map(
hosts,
host =>
hostsById
? subscribeHostMissingPatches(hostsById[host.id][0], patches =>
const unsubs = map(hosts, host =>
subscribeHostMissingPatches(host, patches =>
this.setState({
missingPatches: {
...this.state.missingPatches,
@ -108,7 +100,6 @@ class HostsPatchesTable extends Component {
},
})
)
: noop
)
if (this.unsubscribeMissingPatches !== undefined) {