Skip to content

Commit 01953cf

Browse files
committed
UX
1 parent 3e623d1 commit 01953cf

File tree

1 file changed

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

1 file changed

+13
-12
lines changed

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

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ qx.Class.define("osparc.support.Conversation", {
150150
}
151151
osparc.store.ConversationsSupport.getInstance().postConversation(extraContext)
152152
.then(data => {
153-
const postMessagePromises = [];
153+
let prePostMessagePromise = new Promise((resolve) => resolve());
154154
let isBookACall = false;
155155
// make these checks first, setConversation will reload messages
156156
if (
@@ -164,14 +164,17 @@ qx.Class.define("osparc.support.Conversation", {
164164
this.setConversation(newConversation);
165165
if (isBookACall) {
166166
// add a first message
167-
postMessagePromises.push(this.__postMessage("Book a Call"));
167+
prePostMessagePromise = this.__postMessage("Book a Call");
168168
// rename the conversation
169169
newConversation.renameConversation("Book a Call");
170170
}
171-
postMessagePromises.push(this.__postMessage(content));
172-
Promise.all(postMessagePromises)
171+
prePostMessagePromise
173172
.then(() => {
174-
this.addSystemMessage("followUp");
173+
// add the actual message
174+
return this.__postMessage(content);
175+
})
176+
.then(() => {
177+
setTimeout(() => this.addSystemMessage("followUp"), 1000);
175178
});
176179
});
177180
}
@@ -297,19 +300,17 @@ qx.Class.define("osparc.support.Conversation", {
297300
"type": "MESSAGE",
298301
"userGroupId": "system",
299302
};
300-
let msg = "Hi " + osparc.auth.Data.getInstance().getUserName() + ",\n";
303+
let msg = null;
304+
const greet = "Hi " + osparc.auth.Data.getInstance().getUserName() + ",\n";
301305
switch (type) {
302306
case osparc.support.Conversation.SYSTEM_MESSAGE_TYPE.ASK_A_QUESTION:
303-
msg += "Have a question or feedback?\nWe are happy to assist!";
307+
msg = greet + "Have a question or feedback?\nWe are happy to assist!";
304308
break;
305309
case osparc.support.Conversation.SYSTEM_MESSAGE_TYPE.BOOK_A_CALL:
306-
msg += "Let us know what your availability is and we will get back to you shortly to schedule a meeting.";
307-
break;
308-
case osparc.support.Conversation.SYSTEM_MESSAGE_TYPE.REPORT_OEC:
309-
msg = "";
310+
msg = greet + "Let us know what your availability is and we will get back to you shortly to schedule a meeting.";
310311
break;
311312
case osparc.support.Conversation.SYSTEM_MESSAGE_TYPE.FOLLOW_UP:
312-
msg += "A support ticket has been created.\nOur team will review your request and contact you soon.";
313+
msg = "A support ticket has been created.\nOur team will review your request and contact you soon.";
313314
break;
314315
}
315316
if (msg) {

0 commit comments

Comments
 (0)