Skip to content

Commit e6728b2

Browse files
authored
Merge pull request #4701 from 3drepo/ISSUE_4645
ISSUE #4645 - Fix of project image when creating the project
2 parents d5669aa + 0b58301 commit e6728b2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

frontend/src/v5/store/projects/projects.sagas.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,27 @@ function * updateImage({ teamspace, projectId, image }) {
4747
export function* createProject({ teamspace, project, onSuccess, onImageError, onError }) {
4848
const { name, image } = project;
4949
let projectId;
50+
let newProject;
5051
try {
5152
projectId = yield API.Projects.createProject(teamspace, name);
5253

53-
const newProject = {
54+
newProject = {
5455
_id: projectId,
5556
name,
5657
isAdmin: true,
5758
};
58-
yield put(ProjectsActions.createProjectSuccess(teamspace, newProject));
59-
59+
6060
if (image) {
6161
yield updateImage({ teamspace, projectId, image });
6262
}
63+
64+
yield put(ProjectsActions.createProjectSuccess(teamspace, newProject));
65+
6366
onSuccess();
6467
} catch (error) {
6568
if (projectId) {
6669
onImageError(error, projectId);
70+
yield put(ProjectsActions.createProjectSuccess(teamspace, newProject));
6771
} else {
6872
onError(error);
6973
}

0 commit comments

Comments
 (0)