From eb147d9b9a0a7cc0dd08a03d3c84e8e2159ad9d8 Mon Sep 17 00:00:00 2001 From: Guillermo Rauch Date: Thu, 7 Jul 2016 17:15:42 -0700 Subject: [PATCH] config: add plugins hook and decoration --- app/config.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/config.js b/app/config.js index 5dd62d24..bb4ee888 100644 --- a/app/config.js +++ b/app/config.js @@ -20,17 +20,20 @@ export default class Config extends React.Component { componentDidMount () { ipcRenderer.on('config change', this.onChange); + ipcRenderer.on('plugins change', this.onChange); } // passes `config` as props to the decorated component render () { const child = React.Children.only(this.props.children); const { config } = this.state; - return React.cloneElement(child, { config }); + const decorate = remote.require('./plugins').decorateConfig; + return React.cloneElement(child, { config: decorate(config) }); } componentWillUnmount () { ipcRenderer.removeListener('config change', this.onChange); + ipcRenderer.removeListener('plugins change', this.onChange); } }