fix #243
This commit is contained in:
parent
3ba03d709a
commit
074f5b35b1
3 changed files with 10 additions and 2 deletions
|
@ -8,7 +8,11 @@ function Nav(props) {
|
|||
<li className="nav__item">
|
||||
<a
|
||||
className="nav__new"
|
||||
onClick={props.newProject}
|
||||
onClick={() => {
|
||||
if (props.warnIfUnsavedChanges()) {
|
||||
props.newProject();
|
||||
}
|
||||
}}
|
||||
>
|
||||
New
|
||||
</a>
|
||||
|
|
|
@ -143,7 +143,9 @@ export function resetProject() {
|
|||
}
|
||||
|
||||
export function newProject() {
|
||||
browserHistory.push('/');
|
||||
setTimeout(() => {
|
||||
browserHistory.push('/');
|
||||
}, 0);
|
||||
return resetProject();
|
||||
}
|
||||
|
||||
|
|
|
@ -191,6 +191,7 @@ class IDEView extends React.Component {
|
|||
return false;
|
||||
}
|
||||
this.props.setUnsavedChanges(false);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -209,6 +210,7 @@ class IDEView extends React.Component {
|
|||
stopSketch={this.props.stopSketch}
|
||||
showShareModal={this.props.showShareModal}
|
||||
openForceAuthentication={this.props.openForceAuthentication}
|
||||
warnIfUnsavedChanges={this.warnIfUnsavedChanges}
|
||||
/>
|
||||
<Toolbar
|
||||
className="Toolbar"
|
||||
|
|
Loading…
Reference in a new issue