diff --git a/src/renderer/app.jsx b/src/renderer/app.jsx index d129811..8344616 100644 --- a/src/renderer/app.jsx +++ b/src/renderer/app.jsx @@ -36,8 +36,12 @@ const ScratchDesktopHOC = function (WrappedComponent) { 'handleSetTitleFromSave', 'handleStorageInit', 'handleTelemetryModalOptIn', - 'handleTelemetryModalOptOut' + 'handleTelemetryModalOptOut', + 'handleUpdateProjectTitle' ]); + this.state = { + projectTitle: null + }; } componentDidMount () { ipcRenderer.on('setTitleFromSave', this.handleSetTitleFromSave); @@ -52,7 +56,7 @@ const ScratchDesktopHOC = function (WrappedComponent) { ipcRenderer.send(event, metadata); } handleSetTitleFromSave (event, args) { - this.props.onUpdateProjectTitle(args.title); + this.handleUpdateProjectTitle(args.title); } handleStorageInit (storageInstance) { storageInstance.addHelper(new ElectronStorageHelper(storageInstance)); @@ -63,6 +67,9 @@ const ScratchDesktopHOC = function (WrappedComponent) { handleTelemetryModalOptOut () { ipcRenderer.send('setTelemetryDidOptIn', false); } + handleUpdateProjectTitle (newTitle) { + this.setState({projectTitle: newTitle}); + } render () { const shouldShowTelemetryModal = (typeof ipcRenderer.sendSync('getTelemetryDidOptIn') !== 'boolean'); return (); } } - ScratchDesktopComponent.propTypes = { - onUpdateProjectTitle: PropTypes.func - }; - return ScratchDesktopComponent; }; @@ -91,8 +95,7 @@ const ScratchDesktopHOC = function (WrappedComponent) { // ability to compose reducers. const WrappedGui = compose( AppStateHOC, - TitledHOC, - ScratchDesktopHOC // must come after `TitledHOC` so it has access to `onUpdateProjectTitle` + ScratchDesktopHOC )(GUI); ReactDOM.render(, appTarget);