Skip to content

Commit cce8c8b

Browse files
committed
removeAnnotation
1 parent a8c5ee6 commit cce8c8b

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

services/static-webserver/client/source/class/osparc/workbench/Annotation.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,6 @@ qx.Class.define("osparc.workbench.Annotation", {
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);
139133
}
140134
break;
141135
}

services/static-webserver/client/source/class/osparc/workbench/WorkbenchUI.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2014,6 +2014,15 @@ qx.Class.define("osparc.workbench.WorkbenchUI", {
20142014
this.__addAnnotationListeners(annotation);
20152015
this.__annotations[annotation.getId()] = annotation;
20162016
this.getStudy().getUi().addAnnotation(annotation);
2017+
2018+
if (annotation.getType() === osparc.workbench.Annotation.TYPES.CONVERSATION) {
2019+
osparc.store.Conversations.getInstance().addListener("conversationDeleted", e => {
2020+
const data = e.getData();
2021+
if (data.getAttributes()["conversationId"] === conversationId) {
2022+
this.__removeAnnotation(annotation.getId());
2023+
}
2024+
}, this);
2025+
}
20172026
},
20182027

20192028
__removeAnnotation: function(id) {

0 commit comments

Comments
 (0)