@@ -1971,18 +1971,17 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
19711971 . finally ( ( ) => this . resetSelection ( ) ) ;
19721972 } ,
19731973
1974- __deleteCollaborator : function ( studyData ) {
1974+ __removeMeFromCollaborators : function ( studyData ) {
19751975 const myGid = osparc . auth . Data . getInstance ( ) . getGroupId ( ) ;
19761976 const collabGids = Object . keys ( studyData [ "accessRights" ] ) ;
19771977 const amICollaborator = collabGids . indexOf ( myGid ) > - 1 ;
1978-
19791978 if ( collabGids . length > 1 && amICollaborator ) {
19801979 const arCopy = osparc . utils . Utils . deepCloneObject ( studyData [ "accessRights" ] ) ;
19811980 // remove collaborator
19821981 delete arCopy [ myGid ] ;
1983- // OM here
1984- operationPromise = osparc . info . StudyUtils . patchStudyData ( studyData , "accessRights" , arCopy ) ;
1982+ return osparc . info . StudyUtils . patchStudyData ( studyData , "accessRights" , arCopy ) ;
19851983 }
1984+ return null ;
19861985 } ,
19871986
19881987 __trashStudies : function ( studiesData ) {
@@ -1996,10 +1995,10 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
19961995
19971996 let operationPromise = null ;
19981997 if ( collabGids . length > 1 && amICollaborator ) {
1999- const arCopy = osparc . utils . Utils . deepCloneObject ( studyData [ "accessRights" ] ) ;
2000- // remove collaborator
2001- delete arCopy [ myGid ] ;
2002- operationPromise = osparc . info . StudyUtils . patchStudyData ( studyData , "accessRights" , arCopy ) ;
1998+ operationPromise = this . __removeMeFromCollaborators ( studyData ) ;
1999+ if ( operationPromise === null ) {
2000+ return ;
2001+ }
20032002 } else {
20042003 // delete study
20052004 operationPromise = osparc . store . Store . getInstance ( ) . deleteStudy ( studyData . uuid ) ;
0 commit comments