Skip to content

Commit 9fbff0b

Browse files
committed
use promise
1 parent 884d066 commit 9fbff0b

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

services/static-webserver/client/source/class/osparc/support/SupportCenter.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,22 @@ qx.Class.define("osparc.support.SupportCenter", {
173173
const conversationPage = this.getChildControl("conversation-page");
174174
conversationPage.setConversation(null);
175175
this.__showConversation();
176-
conversationPage.addListenerOnce("changeConversation", e => {
177-
const conversation = e.getData();
178-
// update conversation name and patch extra_context
179-
conversation.renameConversation("Book a call");
180-
conversation.patchExtraContext({
181-
"appointment": "requested"
176+
conversationPage.postMessage(osparc.support.SupportCenter.REQUEST_CALL_MESSAGE)
177+
.then(data => {
178+
const conversationId = data["conversationId"];
179+
osparc.store.ConversationsSupport.getInstance().getConversation(conversationId)
180+
.then(conversation => {
181+
const conversation = e.getData();
182+
// update conversation name and patch extra_context
183+
conversation.renameConversation("Book a call");
184+
conversation.patchExtraContext({
185+
"appointment": "requested"
186+
});
187+
});
188+
})
189+
.catch(err => {
190+
console.error("Error sending request call message", err);
182191
});
183-
});
184-
conversationPage.postMessage(osparc.support.SupportCenter.REQUEST_CALL_MESSAGE);
185192
},
186193
}
187194
});

0 commit comments

Comments
 (0)