Make saving more user-friendly (#561)

* enhance saving

* remove console

* rename

* duplicate when saving others' projects

* fix a bug
This commit is contained in:
Mr.tang 2018-02-24 00:55:14 +08:00 committed by Cassie Tarakajian
parent 61560b87f7
commit 287663494a

View file

@ -157,6 +157,10 @@ class IDEView extends React.Component {
e.stopPropagation();
if (this.isUserOwner() || (this.props.user.authenticated && !this.props.project.owner)) {
this.props.saveProject();
} else if (this.props.user.authenticated) {
this.props.cloneProject();
} else {
this.props.showErrorModal('forceAuthentication');
}
// 13 === enter
} else if (e.keyCode === 13 && e.shiftKey && ((e.metaKey && this.isMac) || (e.ctrlKey && !this.isMac))) {
@ -486,10 +490,10 @@ class IDEView extends React.Component {
<Overlay
title="Error"
ariaLabel="error"
closeOverlay={this.props.hideErrorModal}
>
<ErrorModal
type={this.props.ide.errorType}
closeModal={this.props.hideErrorModal}
/>
</Overlay>
}