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(); e.stopPropagation();
if (this.isUserOwner() || (this.props.user.authenticated && !this.props.project.owner)) { if (this.isUserOwner() || (this.props.user.authenticated && !this.props.project.owner)) {
this.props.saveProject(); this.props.saveProject();
} else if (this.props.user.authenticated) {
this.props.cloneProject();
} else {
this.props.showErrorModal('forceAuthentication');
} }
// 13 === enter // 13 === enter
} else if (e.keyCode === 13 && e.shiftKey && ((e.metaKey && this.isMac) || (e.ctrlKey && !this.isMac))) { } 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 <Overlay
title="Error" title="Error"
ariaLabel="error" ariaLabel="error"
closeOverlay={this.props.hideErrorModal}
> >
<ErrorModal <ErrorModal
type={this.props.ide.errorType} type={this.props.ide.errorType}
closeModal={this.props.hideErrorModal}
/> />
</Overlay> </Overlay>
} }