Removes the createProject IDE action as it's not used (#1097)
This commit is contained in:
parent
8caeb0d439
commit
528f57ad0c
1 changed files with 0 additions and 26 deletions
|
@ -215,32 +215,6 @@ export function autosaveProject() {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createProject() {
|
|
||||||
return (dispatch, getState) => {
|
|
||||||
const state = getState();
|
|
||||||
if (state.project.isSaving) {
|
|
||||||
Promise.resolve();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
dispatch(startSavingProject());
|
|
||||||
axios.post(`${ROOT_URL}/projects`, {}, { withCredentials: true })
|
|
||||||
.then((response) => {
|
|
||||||
dispatch(endSavingProject());
|
|
||||||
dispatch(setUnsavedChanges(false));
|
|
||||||
browserHistory.push(`/${response.data.user.username}/sketches/${response.data.id}`);
|
|
||||||
const { hasChanges, synchedProject } = getSynchedProject(getState(), response.data);
|
|
||||||
if (hasChanges) {
|
|
||||||
dispatch(setUnsavedChanges(true));
|
|
||||||
}
|
|
||||||
dispatch(setNewProject(synchedProject));
|
|
||||||
})
|
|
||||||
.catch((response) => {
|
|
||||||
dispatch(endSavingProject());
|
|
||||||
dispatch(projectSaveFail(response.data));
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export function exportProjectAsZip(projectId) {
|
export function exportProjectAsZip(projectId) {
|
||||||
const win = window.open(`${ROOT_URL}/projects/${projectId}/zip`, '_blank');
|
const win = window.open(`${ROOT_URL}/projects/${projectId}/zip`, '_blank');
|
||||||
win.focus();
|
win.focus();
|
||||||
|
|
Loading…
Reference in a new issue