mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-02-02 10:25:21 +00:00
call getProcesses in componentDidMount
This commit is contained in:
parent
59757c08e2
commit
d9b8b5ff68
@ -12,16 +12,24 @@ import {getProcesses, getCommands, getVersions, getProcessLogs} from "../reducer
|
|||||||
import deepEqual from 'deep-equal';
|
import deepEqual from 'deep-equal';
|
||||||
|
|
||||||
class HomeContainer extends Component {
|
class HomeContainer extends Component {
|
||||||
|
componentDidMount() {
|
||||||
|
this.getProcesses();
|
||||||
|
}
|
||||||
|
|
||||||
componentDidUpdate(prevProps) {
|
componentDidUpdate(prevProps) {
|
||||||
if (!deepEqual(this.props.processes, prevProps.processes)) {
|
if (!deepEqual(this.props.processes, prevProps.processes)) {
|
||||||
|
this.getProcesses(prevProps);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getProcesses(prevProps) {
|
||||||
this.props.processes.forEach(process => {
|
this.props.processes.forEach(process => {
|
||||||
this.props.fetchProcessLogs(process.name);
|
this.props.fetchProcessLogs(process.name);
|
||||||
if (!prevProps.processes.length) {
|
if (!prevProps || !prevProps.processes.length) {
|
||||||
this.props.listenToProcessLogs(process.name);
|
this.props.listenToProcessLogs(process.name);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user