From d6c2e96e34757352a6f34b920adc255256af1526 Mon Sep 17 00:00:00 2001 From: Roberto Bruggemann Date: Mon, 26 Feb 2018 22:50:58 +0000 Subject: [PATCH] Dispatch 'Monitor' flag `render` function (#3072) Adds update of monitor availability when it appears/disappears. The constructor is only called once at the beginning. --- client/app/scripts/components/app.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/app/scripts/components/app.js b/client/app/scripts/components/app.js index e48c6c368..60a645a6b 100644 --- a/client/app/scripts/components/app.js +++ b/client/app/scripts/components/app.js @@ -99,6 +99,12 @@ class App extends React.Component { this.router.stop(); } + componentWillReceiveProps(nextProps) { + if (nextProps.monitor !== this.props.monitor) { + this.props.dispatch(setMonitorState(nextProps.monitor)); + } + } + onKeyUp(ev) { const { showingTerminal } = this.props; keyPressLog('onKeyUp', 'keyCode', ev.keyCode, ev);