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

also use canCreateNew when deciding whether to js confirm

parent 1e0dae57
No related branches found
No related tags found
No related merge requests found
......@@ -150,9 +150,9 @@ class MenuBar extends React.Component {
}
}
handleClickNew () {
// if canSave===true, it's safe to replace current project, since we will auto-save first.
// else confirm first.
const readyToReplaceProject = this.props.canSave ||
// if canSave===true and canCreateNew===true, it's safe to replace current project,
// since we will auto-save first. Else, confirm first.
const readyToReplaceProject = (this.props.canSave && this.props.canCreateNew) ||
confirm('Replace contents of the current project?'); // eslint-disable-line no-alert
this.props.onRequestCloseFile();
if (readyToReplaceProject) {
......
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