From 86b2dcc2da8632f2d2a8eaeaeca049fee1c65352 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Thu, 13 Sep 2018 15:11:51 -0400 Subject: [PATCH] call getProcesses in componentDidMount --- embark-ui/src/containers/HomeContainer.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/embark-ui/src/containers/HomeContainer.js b/embark-ui/src/containers/HomeContainer.js index 7472d01e..e5e635e6 100644 --- a/embark-ui/src/containers/HomeContainer.js +++ b/embark-ui/src/containers/HomeContainer.js @@ -12,17 +12,25 @@ 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.props.processes.forEach(process => { - this.props.fetchProcessLogs(process.name); - if (!prevProps.processes.length) { - this.props.listenToProcessLogs(process.name); - } - }); + this.getProcesses(prevProps); } } + getProcesses(prevProps) { + this.props.processes.forEach(process => { + this.props.fetchProcessLogs(process.name); + if (!prevProps || !prevProps.processes.length) { + this.props.listenToProcessLogs(process.name); + } + }); + } + render() { return (