diff --git a/client/modules/IDE/actions/project.js b/client/modules/IDE/actions/project.js index b3da6819..8d1c6383 100644 --- a/client/modules/IDE/actions/project.js +++ b/client/modules/IDE/actions/project.js @@ -262,7 +262,7 @@ function generateNewIdsForChildren(file, files) { export function cloneProject(id) { return (dispatch, getState) => { dispatch(setUnsavedChanges(false)); - new Promise((resolve, reject) => { + return new Promise((resolve, reject) => { if (!id) { resolve(getState()); } else { diff --git a/client/modules/IDE/components/Toolbar.jsx b/client/modules/IDE/components/Toolbar.jsx index 1af979cc..29572cb8 100644 --- a/client/modules/IDE/components/Toolbar.jsx +++ b/client/modules/IDE/components/Toolbar.jsx @@ -58,11 +58,14 @@ class Toolbar extends React.Component { } render() { + const canEditProjectName = this.canEditProjectName(); + const playButtonClass = classNames({ 'toolbar__play-button': true, 'toolbar__play-button--selected': this.props.isPlaying, 'toolbar__play-button--saved': this.props.isSaved, - 'toolbar__play-button--unsaved': !this.props.isSaved + 'toolbar__play-button--unsaved': !this.props.isSaved, + 'toolbar__play-button--clone': this.props.unsavedChanges && !canEditProjectName }); const stopButtonClass = classNames({ 'toolbar__stop-button': true, @@ -77,8 +80,6 @@ class Toolbar extends React.Component { 'toolbar__project-name-container--editing': this.props.project.isEditingName }); - const canEditProjectName = this.canEditProjectName(); - return (