close file menu on uploading sb file; don't close file menu twice

This commit is contained in:
Ben Wheeler committed 2018-12-12 14:00:12 -05:00
1 parent 61c02651b1
commit 72103b1de0
2 files changed
+4 -1

No files matched your search

-1
View File
@@ -161,7 +161,6 @@ class MenuBar extends React.Component {
// since we will auto-save first. Else, confirm first.
const readyToReplaceProject = (this.props.canSave && this.props.canCreateNew) ||
confirm(this.props.intl.formatMessage(messages.confirmNav)); // eslint-disable-line no-alert
this.props.onRequestCloseFile();
if (readyToReplaceProject) {
this.props.onClickNew(this.props.canSave && this.props.canCreateNew);
}
+4
View File
@@ -12,6 +12,9 @@ import {
openLoadingProject,
closeLoadingProject
} from '../reducers/modals';
import {
closeFileMenu
} from '../reducers/menus';
/**
* SBFileUploader component passes a file input, load handler and props to its child.
@@ -136,6 +139,7 @@ const mapDispatchToProps = (dispatch, ownProps) => ({
onLoadingFinished: loadingState => {
dispatch(onLoadedProject(loadingState, ownProps.canSave));
dispatch(closeLoadingProject());
dispatch(closeFileMenu());
},
onLoadingStarted: () => {
dispatch(openLoadingProject());