File tree Expand file tree Collapse file tree
js/components/snapshot/redux Expand file tree Collapse file tree Original file line number Diff line number Diff 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 =
You can’t perform that action at this time.
0 commit comments