Skip to content

Commit 3e623d1

Browse files
committed
renameConversation
1 parent 259afe0 commit 3e623d1

File tree

1 file changed

+8
-2
lines changed
  • services/static-webserver/client/source/class/osparc/support

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,17 +151,23 @@ qx.Class.define("osparc.support.Conversation", {
151151
osparc.store.ConversationsSupport.getInstance().postConversation(extraContext)
152152
.then(data => {
153153
const postMessagePromises = [];
154+
let isBookACall = false;
155+
// make these checks first, setConversation will reload messages
154156
if (
155157
this.__messages.length === 1 &&
156158
this.__messages[0]["systemMessageType"] &&
157159
osparc.support.Conversation.SYSTEM_MESSAGE_TYPE.BOOK_A_CALL
158160
) {
161+
isBookACall = true;
162+
}
163+
const newConversation = new osparc.data.model.Conversation(data);
164+
this.setConversation(newConversation);
165+
if (isBookACall) {
159166
// add a first message
160167
postMessagePromises.push(this.__postMessage("Book a Call"));
161168
// rename the conversation
169+
newConversation.renameConversation("Book a Call");
162170
}
163-
const newConversation = new osparc.data.model.Conversation(data);
164-
this.setConversation(newConversation);
165171
postMessagePromises.push(this.__postMessage(content));
166172
Promise.all(postMessagePromises)
167173
.then(() => {

0 commit comments

Comments
 (0)