File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
services/static-webserver/client/source/class/osparc Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,8 @@ qx.Class.define("osparc.store.Conversations", {
2626 } ,
2727
2828 events : {
29- "conversationUpdated" : "qx.event.type.Data" ,
29+ "conversationRenamed" : "qx.event.type.Data" ,
30+ "conversationDeleted" : "qx.event.type.Data" ,
3031 } ,
3132
3233 members : {
@@ -78,6 +79,12 @@ qx.Class.define("osparc.store.Conversations", {
7879 } ,
7980 } ;
8081 return osparc . data . Resources . fetch ( "conversations" , "deleteConversation" , params )
82+ . then ( ( ) => {
83+ this . fireDataEvent ( "conversationDeleted" , {
84+ studyId,
85+ conversationId,
86+ } )
87+ } )
8188 . catch ( err => osparc . FlashMessenger . logError ( err ) ) ;
8289 } ,
8390
@@ -93,7 +100,7 @@ qx.Class.define("osparc.store.Conversations", {
93100 } ;
94101 return osparc . data . Resources . fetch ( "conversations" , "renameConversation" , params )
95102 . then ( ( ) => {
96- this . fireDataEvent ( "conversationUpdated " , {
103+ this . fireDataEvent ( "conversationRenamed " , {
97104 studyId,
98105 conversationId,
99106 name,
Original file line number Diff line number Diff line change @@ -124,12 +124,18 @@ qx.Class.define("osparc.workbench.Annotation", {
124124 representation = this . __svgLayer . drawAnnotationConversation ( attrs . x , attrs . y , attrs . text ) ;
125125 const conversationId = attrs . conversationId ;
126126 if ( conversationId ) {
127- osparc . store . Conversations . getInstance ( ) . addListener ( "conversationUpdated " , e => {
127+ osparc . store . Conversations . getInstance ( ) . addListener ( "conversationRenamed " , e => {
128128 const data = e . getData ( ) ;
129129 if ( data . conversationId === conversationId ) {
130130 this . setText ( data . name ) ;
131131 }
132132 } , this ) ;
133+ osparc . store . Conversations . getInstance ( ) . addListener ( "conversationDeleted" , e => {
134+ const data = e . getData ( ) ;
135+ if ( data . conversationId === conversationId ) {
136+ osparc . wrapper . Svg . removeItem ( representation ) ;
137+ }
138+ } , this ) ;
133139 }
134140 break ;
135141 }
You can’t perform that action at this time.
0 commit comments