mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-03-27 15:55:55 +00:00
Merge branch 'master' of https://github.com/Qortal/qortal-ui
This commit is contained in:
commit
3d9f730285
@ -1421,6 +1421,12 @@ class ChatPage extends LitElement {
|
|||||||
})
|
})
|
||||||
document.addEventListener('keydown', this.initialChat);
|
document.addEventListener('keydown', this.initialChat);
|
||||||
document.addEventListener('paste', this.pasteImage);
|
document.addEventListener('paste', this.pasteImage);
|
||||||
|
if(this.chatId){
|
||||||
|
window.parent.reduxStore.dispatch( window.parent.reduxAction.addChatLastSeen({
|
||||||
|
key: this.chatId,
|
||||||
|
timestamp: Date.now()
|
||||||
|
}))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
disconnectedCallback() {
|
disconnectedCallback() {
|
||||||
@ -1444,7 +1450,7 @@ class ChatPage extends LitElement {
|
|||||||
|
|
||||||
document.removeEventListener('keydown', this.initialChat);
|
document.removeEventListener('keydown', this.initialChat);
|
||||||
document.removeEventListener('paste', this.pasteImage);
|
document.removeEventListener('paste', this.pasteImage);
|
||||||
if(this.messagesRendered.length !== 0){
|
if(this.chatId){
|
||||||
window.parent.reduxStore.dispatch( window.parent.reduxAction.addChatLastSeen({
|
window.parent.reduxStore.dispatch( window.parent.reduxAction.addChatLastSeen({
|
||||||
key: this.chatId,
|
key: this.chatId,
|
||||||
timestamp: Date.now()
|
timestamp: Date.now()
|
||||||
@ -2181,7 +2187,13 @@ class ChatPage extends LitElement {
|
|||||||
await this.renderNewMessage(msg)
|
await this.renderNewMessage(msg)
|
||||||
})
|
})
|
||||||
await Promise.all(renderEachMessage)
|
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.newMessages = this.newMessages.concat(_newMessages)
|
||||||
this.messagesRendered = [...this.messagesRendered].sort(function (a, b) {
|
this.messagesRendered = [...this.messagesRendered].sort(function (a, b) {
|
||||||
return a.timestamp
|
return a.timestamp
|
||||||
|
@ -887,7 +887,7 @@ class Chat extends LitElement {
|
|||||||
setChatHeads(chatObj) {
|
setChatHeads(chatObj) {
|
||||||
const chatObjGroups = Array.isArray(chatObj.groups) ? chatObj.groups : [];
|
const chatObjGroups = Array.isArray(chatObj.groups) ? chatObj.groups : [];
|
||||||
const chatObjDirect = Array.isArray(chatObj.direct) ? chatObj.direct : [];
|
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 => {
|
let directList = chatObjDirect.map(dc => {
|
||||||
return { ...dc, url: `direct/${dc.address}` }
|
return { ...dc, url: `direct/${dc.address}` }
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user