Skip to content

Commit c2ab84c

Browse files
committed
post predefined message
1 parent d811d13 commit c2ab84c

File tree

1 file changed

+12
-1
lines changed
  • services/static-webserver/client/source/class/osparc/support

1 file changed

+12
-1
lines changed

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,20 @@ qx.Class.define("osparc.support.Conversation", {
150150
}
151151
osparc.store.ConversationsSupport.getInstance().postConversation(extraContext)
152152
.then(data => {
153+
const postMessagePromises = [];
154+
if (
155+
this.__messages.length === 1 &&
156+
this.__messages[0]["systemMessageType"] &&
157+
osparc.support.Conversation.SYSTEM_MESSAGE_TYPE.BOOK_A_CALL
158+
) {
159+
// add a first message
160+
postMessagePromises.push(this.__postMessage("Book a Call"));
161+
// rename the conversation
162+
}
153163
const newConversation = new osparc.data.model.Conversation(data);
154164
this.setConversation(newConversation);
155-
this.__postMessage(content)
165+
postMessagePromises.push(this.__postMessage(content));
166+
Promise.all(postMessagePromises)
156167
.then(() => {
157168
this.addSystemMessage("followUp");
158169
});

0 commit comments

Comments
 (0)