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">
|
<li className="nav__item">
|
||||||
<a
|
<a
|
||||||
className="nav__new"
|
className="nav__new"
|
||||||
onClick={props.newProject}
|
onClick={() => {
|
||||||
|
if (props.warnIfUnsavedChanges()) {
|
||||||
|
props.newProject();
|
||||||
|
}
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
New
|
New
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -143,7 +143,9 @@ export function resetProject() {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function newProject() {
|
export function newProject() {
|
||||||
|
setTimeout(() => {
|
||||||
browserHistory.push('/');
|
browserHistory.push('/');
|
||||||
|
}, 0);
|
||||||
return resetProject();
|
return resetProject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -191,6 +191,7 @@ class IDEView extends React.Component {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.props.setUnsavedChanges(false);
|
this.props.setUnsavedChanges(false);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,6 +210,7 @@ class IDEView extends React.Component {
|
||||||
stopSketch={this.props.stopSketch}
|
stopSketch={this.props.stopSketch}
|
||||||
showShareModal={this.props.showShareModal}
|
showShareModal={this.props.showShareModal}
|
||||||
openForceAuthentication={this.props.openForceAuthentication}
|
openForceAuthentication={this.props.openForceAuthentication}
|
||||||
|
warnIfUnsavedChanges={this.warnIfUnsavedChanges}
|
||||||
/>
|
/>
|
||||||
<Toolbar
|
<Toolbar
|
||||||
className="Toolbar"
|
className="Toolbar"
|
||||||
|
|
Loading…
Reference in a new issue