This commit is contained in:
Cassie Tarakajian 2017-03-06 14:13:39 -05:00
parent abbeb7fc60
commit 134cc76981
2 changed files with 7 additions and 2 deletions

View file

@ -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,

View file

@ -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') {