Skip to content

Commit 88c9262

Browse files
- #1707 - clean up is done. If additional unnecessary code is found, during implementation of new snapshot navigation, it will be removed
1 parent ef54682 commit 88c9262

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

js/components/snapshot/redux/dispatchActions.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,8 @@ export const saveAndShareSnapshot = (
441441
axuData = {},
442442
overwriteSnapshot = false,
443443
snapshotIdToOverwrite = 0,
444-
oldImages = []
444+
oldImages = [],
445+
sessionProjectId = 0
445446
) => async (dispatch, getState) => {
446447
dispatch(setSnapshotIsSaving(true));
447448
const snapshotData = dispatch(getCleanStateForSnapshot());
@@ -450,7 +451,6 @@ export const saveAndShareSnapshot = (
450451
const targetId = state.apiReducers.target_on;
451452
const loggedInUserID = DJANGO_CONTEXT['pk'];
452453
const currentProject = state.targetReducers.currentProject;
453-
const currentSessionProject = state.projectReducers.currentProject;
454454

455455
dispatch(setDisableRedirect(true));
456456

@@ -480,7 +480,10 @@ export const saveAndShareSnapshot = (
480480
};
481481

482482
try {
483-
let projectID = await dispatch(createProjectWithoutStateModification(data));
483+
let projectID = sessionProjectId;
484+
if (!overwriteSnapshot || !projectID) {
485+
projectID = await dispatch(createProjectWithoutStateModification(data));
486+
}
484487
const username = DJANGO_CONTEXT['username'];
485488
const title = moment().format('-- YYYY-MM-DD -- HH:mm:ss');
486489
const description =

0 commit comments

Comments
 (0)