Skip to content
Snippets Groups Projects
Unverified Commit 49dc93f9 authored by Benjamin Wheeler's avatar Benjamin Wheeler Committed by GitHub
Browse files

Merge pull request #4033 from benjiwheeler/close-file-menu2

close file menu on uploading sb file; don't close file menu twice
parents 9c09a8d9 72103b1d
No related branches found
No related tags found
No related merge requests found
...@@ -161,7 +161,6 @@ class MenuBar extends React.Component { ...@@ -161,7 +161,6 @@ class MenuBar extends React.Component {
// since we will auto-save first. Else, confirm first. // since we will auto-save first. Else, confirm first.
const readyToReplaceProject = (this.props.canSave && this.props.canCreateNew) || const readyToReplaceProject = (this.props.canSave && this.props.canCreateNew) ||
confirm(this.props.intl.formatMessage(messages.confirmNav)); // eslint-disable-line no-alert confirm(this.props.intl.formatMessage(messages.confirmNav)); // eslint-disable-line no-alert
this.props.onRequestCloseFile();
if (readyToReplaceProject) { if (readyToReplaceProject) {
this.props.onClickNew(this.props.canSave && this.props.canCreateNew); this.props.onClickNew(this.props.canSave && this.props.canCreateNew);
} }
......
...@@ -12,6 +12,9 @@ import { ...@@ -12,6 +12,9 @@ import {
openLoadingProject, openLoadingProject,
closeLoadingProject closeLoadingProject
} from '../reducers/modals'; } from '../reducers/modals';
import {
closeFileMenu
} from '../reducers/menus';
/** /**
* SBFileUploader component passes a file input, load handler and props to its child. * SBFileUploader component passes a file input, load handler and props to its child.
...@@ -136,6 +139,7 @@ const mapDispatchToProps = (dispatch, ownProps) => ({ ...@@ -136,6 +139,7 @@ const mapDispatchToProps = (dispatch, ownProps) => ({
onLoadingFinished: loadingState => { onLoadingFinished: loadingState => {
dispatch(onLoadedProject(loadingState, ownProps.canSave)); dispatch(onLoadedProject(loadingState, ownProps.canSave));
dispatch(closeLoadingProject()); dispatch(closeLoadingProject());
dispatch(closeFileMenu());
}, },
onLoadingStarted: () => { onLoadingStarted: () => {
dispatch(openLoadingProject()); dispatch(openLoadingProject());
......
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