Skip to content

Commit 1c4e6c5

Browse files
committed
fix list item
1 parent faf0cc0 commit 1c4e6c5

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,25 +47,25 @@ qx.Class.define("osparc.support.ConversationListItem", {
4747
members: {
4848
__applyConversation: function(conversation) {
4949
conversation.bind("nameAlias", this, "title");
50-
const messages = conversation.getMessages();
51-
if (messages && messages.length) {
52-
const lastMessage = messages[0];
53-
const date = osparc.utils.Utils.formatDateAndTime(new Date(lastMessage.created));
54-
this.set({
55-
subtitle: date,
56-
});
57-
58-
const userGroupId = lastMessage.userGroupId;
59-
osparc.store.Users.getInstance().getUser(userGroupId)
60-
.then(user => {
61-
if (user) {
62-
this.set({
63-
thumbnail: user.getThumbnail(),
64-
subtitle: user.getLabel() + " - " + date,
50+
osparc.store.ConversationsSupport.getInstance().getLastMessage(conversation.getConversationId())
51+
.then(lastMessage => {
52+
if (lastMessage) {
53+
const date = osparc.utils.Utils.formatDateAndTime(new Date(lastMessage.created));
54+
this.set({
55+
subtitle: date,
56+
});
57+
const userGroupId = lastMessage.userGroupId;
58+
osparc.store.Users.getInstance().getUser(userGroupId)
59+
.then(user => {
60+
if (user) {
61+
this.set({
62+
thumbnail: user.getThumbnail(),
63+
subtitle: user.getLabel() + " - " + date,
64+
});
65+
}
6566
});
66-
}
67-
});
68-
}
67+
}
68+
});
6969
},
7070
}
7171
});

0 commit comments

Comments
 (0)