From 134cc76981a864eaaeb86d9eb7e8cd0082062047 Mon Sep 17 00:00:00 2001 From: Cassie Tarakajian Date: Mon, 6 Mar 2017 14:13:39 -0500 Subject: [PATCH] fix #317 --- client/modules/IDE/actions/project.js | 7 ++++++- client/modules/IDE/components/Editor.jsx | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/client/modules/IDE/actions/project.js b/client/modules/IDE/actions/project.js index 3aff9e00..20065b71 100644 --- a/client/modules/IDE/actions/project.js +++ b/client/modules/IDE/actions/project.js @@ -53,6 +53,7 @@ export function saveProject(autosave = false) { axios.put(`${ROOT_URL}/projects/${state.project.id}`, formParams, { withCredentials: true }) .then((response) => { dispatch(setUnsavedChanges(false)); + console.log(response.data); dispatch(setProject(response.data)); dispatch({ type: ActionTypes.PROJECT_SAVE_SUCCESS @@ -180,7 +181,10 @@ export function cloneProject() { return (dispatch, getState) => { dispatch(setUnsavedChanges(false)); const state = getState(); - const newFiles = [...state.files]; + const newFiles = state.files.map((file) => { // eslint-disable-line + return { ...file }; + }); + const rootFile = newFiles.find(file => file.name === 'root'); const newRootFileId = objectID().toHexString(); rootFile.id = newRootFileId; @@ -191,6 +195,7 @@ export function cloneProject() { axios.post(`${ROOT_URL}/projects`, formParams, { withCredentials: true }) .then((response) => { browserHistory.push(`/${response.data.user.username}/sketches/${response.data.id}`); + console.log(response.data); dispatch({ type: ActionTypes.NEW_PROJECT, project: response.data, diff --git a/client/modules/IDE/components/Editor.jsx b/client/modules/IDE/components/Editor.jsx index 9d8724a0..d5d75bff 100644 --- a/client/modules/IDE/components/Editor.jsx +++ b/client/modules/IDE/components/Editor.jsx @@ -114,7 +114,6 @@ class Editor extends React.Component { if (this.props.files.length !== nextProps.files.length) { this.initializeDocuments(nextProps.files); } - console.log(nextProps.projectSavedTime); } componentDidUpdate(prevProps) { @@ -162,6 +161,7 @@ class Editor extends React.Component { } initializeDocuments(files) { + console.log('calling initialize documents'); this._docs = {}; files.forEach((file) => { if (file.name !== 'root') {