diff --git a/src/components/menu-bar/menu-bar.jsx b/src/components/menu-bar/menu-bar.jsx index e40db73ab6ce47b50072dc4ecb32b25b48277de1..573b4b3542fb8e1a624372f27cf210690cd896d8 100644 --- a/src/components/menu-bar/menu-bar.jsx +++ b/src/components/menu-bar/menu-bar.jsx @@ -138,22 +138,13 @@ class MenuBar extends React.Component { 'handleRestoreOption', 'restoreOptionMessage' ]); - this.state = {projectSaveInProgress: false}; } - componentWillReceiveProps (newProps) { + componentDidUpdate (prevProps) { // if we're no longer showing the project (loading, or whatever), close menus - if (newProps.isShowingProject && !this.props.isShowingProject) { + if (this.props.isShowingProject && !prevProps.isShowingProject) { this.props.onRequestCloseFile(); this.props.onRequestCloseEdit(); } - // if we're now saving, show save in progress - if (newProps.isSavingWithId && !this.props.isSavingWithId) { - this.setState({projectSaveInProgress: true}); - } - // if we're no longer saving, don't show save in progress - if (!newProps.isSavingWithId && this.props.isSavingWithId) { - this.setState({projectSaveInProgress: false}); - } } handleClickNew () { if (this.props.sessionExists && this.props.username) { // logged in @@ -240,7 +231,7 @@ class MenuBar extends React.Component { className={classNames( this.props.className, styles.menuBar, - {[styles.saveInProgress]: this.state.projectSaveInProgress} + {[styles.saveInProgress]: this.props.isSavingWithId} )} > <div className={styles.mainMenu}>