call getProcesses in componentDidMount
This commit is contained in:
parent
ae3185d96f
commit
86b2dcc2da
|
@ -12,16 +12,24 @@ import {getProcesses, getCommands, getVersions, getProcessLogs} from "../reducer
|
|||
import deepEqual from 'deep-equal';
|
||||
|
||||
class HomeContainer extends Component {
|
||||
componentDidMount() {
|
||||
this.getProcesses();
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps) {
|
||||
if (!deepEqual(this.props.processes, prevProps.processes)) {
|
||||
this.getProcesses(prevProps);
|
||||
}
|
||||
}
|
||||
|
||||
getProcesses(prevProps) {
|
||||
this.props.processes.forEach(process => {
|
||||
this.props.fetchProcessLogs(process.name);
|
||||
if (!prevProps.processes.length) {
|
||||
if (!prevProps || !prevProps.processes.length) {
|
||||
this.props.listenToProcessLogs(process.name);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
|
|
Loading…
Reference in New Issue