diff --git a/qortal-ui-plugins/plugins/core/components/ChatPage.js b/qortal-ui-plugins/plugins/core/components/ChatPage.js index 8aacdc1b..bb6023b1 100644 --- a/qortal-ui-plugins/plugins/core/components/ChatPage.js +++ b/qortal-ui-plugins/plugins/core/components/ChatPage.js @@ -1421,6 +1421,12 @@ class ChatPage extends LitElement { }) document.addEventListener('keydown', this.initialChat); document.addEventListener('paste', this.pasteImage); + if(this.chatId){ + window.parent.reduxStore.dispatch( window.parent.reduxAction.addChatLastSeen({ + key: this.chatId, + timestamp: Date.now() + })) + } } disconnectedCallback() { @@ -1444,7 +1450,7 @@ class ChatPage extends LitElement { document.removeEventListener('keydown', this.initialChat); document.removeEventListener('paste', this.pasteImage); - if(this.messagesRendered.length !== 0){ + if(this.chatId){ window.parent.reduxStore.dispatch( window.parent.reduxAction.addChatLastSeen({ key: this.chatId, timestamp: Date.now() @@ -2181,7 +2187,13 @@ class ChatPage extends LitElement { await this.renderNewMessage(msg) }) await Promise.all(renderEachMessage) - + if(this.chatId){ + window.parent.reduxStore.dispatch( window.parent.reduxAction.addChatLastSeen({ + key: this.chatId, + timestamp: Date.now() + })) + + } // this.newMessages = this.newMessages.concat(_newMessages) this.messagesRendered = [...this.messagesRendered].sort(function (a, b) { return a.timestamp diff --git a/qortal-ui-plugins/plugins/core/messaging/q-chat/q-chat.src.js b/qortal-ui-plugins/plugins/core/messaging/q-chat/q-chat.src.js index e618a1b0..3ed87067 100644 --- a/qortal-ui-plugins/plugins/core/messaging/q-chat/q-chat.src.js +++ b/qortal-ui-plugins/plugins/core/messaging/q-chat/q-chat.src.js @@ -887,7 +887,7 @@ class Chat extends LitElement { setChatHeads(chatObj) { const chatObjGroups = Array.isArray(chatObj.groups) ? chatObj.groups : []; const chatObjDirect = Array.isArray(chatObj.direct) ? chatObj.direct : []; - let groupList = chatObjGroups.map(group => group.groupId === 0 ? { groupId: group.groupId, url: `group/${group.groupId}`, groupName: "Qortal General Chat", timestamp: group.timestamp === undefined ? 2 : group.timestamp } : { ...group, timestamp: group.timestamp === undefined ? 1 : group.timestamp, url: `group/${group.groupId}` }) + let groupList = chatObjGroups.map(group => group.groupId === 0 ? { groupId: group.groupId, url: `group/${group.groupId}`, groupName: "Qortal General Chat", timestamp: group.timestamp === undefined ? 2 : group.timestamp, sender: group.sender } : { ...group, timestamp: group.timestamp === undefined ? 1 : group.timestamp, url: `group/${group.groupId}` }) let directList = chatObjDirect.map(dc => { return { ...dc, url: `direct/${dc.address}` } })