Skip to content

Commit 4c25532

Browse files
committed
conversationButton, blink
1 parent 13901c2 commit 4c25532

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,16 +442,17 @@ qx.Class.define("osparc.desktop.WorkbenchView", {
442442

443443
this.__addTopBarSpacer(topBar);
444444

445-
const commentsButton = new qx.ui.form.Button().set({
445+
const conversationButton = new qx.ui.form.Button().set({
446446
appearance: "form-button-outlined",
447447
toolTipText: this.tr("Conversations"),
448448
icon: "@FontAwesome5Solid/comments/16",
449449
marginRight: 10,
450450
marginTop: 7,
451451
...osparc.navigation.NavigationBar.BUTTON_OPTIONS
452452
});
453-
commentsButton.addListener("execute", () => osparc.study.Conversations.popUpInWindow(study.serialize()));
454-
topBar.add(commentsButton);
453+
osparc.study.Conversations.makeButtonBlink(conversationButton);
454+
conversationButton.addListener("execute", () => osparc.study.Conversations.popUpInWindow(study.serialize()));
455+
topBar.add(conversationButton);
455456

456457
const startAppButtonTB = this.__startAppButtonTB = new qx.ui.form.Button().set({
457458
appearance: "form-button-outlined",

services/static-webserver/client/source/class/osparc/study/Conversations.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ qx.Class.define("osparc.study.Conversations", {
5252
PROJECT_ANNOTATION: "PROJECT_ANNOTATION",
5353
},
5454

55-
5655
CHANNELS: {
5756
CONVERSATION_CREATED: "conversation:created",
5857
CONVERSATION_UPDATED: "conversation:updated",
@@ -73,6 +72,17 @@ qx.Class.define("osparc.study.Conversations", {
7372
}, this);
7473
return win;
7574
},
75+
76+
makeButtonBlink: function(button) {
77+
const socket = osparc.wrapper.WebSocket.getInstance();
78+
Object.values(osparc.study.Conversations.CHANNELS).forEach(eventName => {
79+
socket.on(eventName, () => {
80+
if (button) {
81+
osparc.utils.Utils.makeButtonBlink(button);
82+
}
83+
});
84+
});
85+
},
7686
},
7787

7888
members: {

0 commit comments

Comments
 (0)