Skip to content
Snippets Groups Projects
Commit e82180e0 authored by Ben Wheeler's avatar Ben Wheeler
Browse files

using project-id state for menu-bar's saving indicator

parent d3011375
No related branches found
No related tags found
No related merge requests found
......@@ -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}>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment