Skip to content

Commit 8d97537

Browse files
committed
minor
1 parent cc93862 commit 8d97537

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,15 @@ qx.Class.define("osparc.support.ConversationListItem", {
9797
__applyConversation: function(conversation) {
9898
conversation.bind("nameAlias", this, "title");
9999

100-
this.__populateWithLastMessage();
101-
conversation.addListener("changeLastMessage", this.__populateWithLastMessage, this);
100+
this.__lastMessageChanged();
101+
conversation.addListener("changeLastMessage", this.__lastMessageChanged, this);
102102

103-
this.__populateWithFirstMessage();
104-
conversation.addListener("changeFirstMessage", this.__populateWithFirstMessage, this);
103+
this.__firstMessageChanged();
104+
conversation.addListener("changeFirstMessage", this.__firstMessageChanged, this);
105+
106+
conversation.bind("lastMessageCreatedAt", this, "role", {
107+
converter: val => osparc.utils.Utils.formatDateAndTime(val),
108+
});
105109

106110
const unreadBadge = this.getChildControl("unread-badge");
107111
const propName = osparc.store.Groups.getInstance().amIASupportUser() ? "readBySupport" : "readByUser";
@@ -137,11 +141,8 @@ qx.Class.define("osparc.support.ConversationListItem", {
137141
*/
138142
},
139143

140-
__populateWithLastMessage: function() {
144+
__lastMessageChanged: function() {
141145
const conversation = this.getConversation();
142-
this.set({
143-
role: osparc.utils.Utils.formatDateAndTime(conversation.getLastMessageCreatedAt()),
144-
});
145146
const lastMessage = conversation.getLastMessage();
146147
if (lastMessage) {
147148
const userGroupId = lastMessage.getUserGroupId();
@@ -157,7 +158,7 @@ qx.Class.define("osparc.support.ConversationListItem", {
157158
}
158159
},
159160

160-
__populateWithFirstMessage: function() {
161+
__firstMessageChanged: function() {
161162
const conversation = this.getConversation();
162163
const firstMessage = conversation.getFirstMessage();
163164
if (firstMessage) {

0 commit comments

Comments
 (0)