diff options
| author | Maksim Pechnikov <parallel588@gmail.com> | 2020-09-18 22:03:11 +0300 |
|---|---|---|
| committer | Maksim Pechnikov <parallel588@gmail.com> | 2020-09-18 22:03:11 +0300 |
| commit | b725df6352c27421f0549b6e4c2ceeb0d240919f (patch) | |
| tree | a0a733302b9ab28e50419bb13937dc261d09646b /src/components/chat/chat.js | |
| parent | fa2b680855c790ba8ed8d7cc0dbf2a3a2e1dbaf6 (diff) | |
| parent | 0fee9a8fe71faed789589aae6ff1bf3434e01e93 (diff) | |
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma-fe into develop
Diffstat (limited to 'src/components/chat/chat.js')
| -rw-r--r-- | src/components/chat/chat.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/components/chat/chat.js b/src/components/chat/chat.js index 9c4e5b05..803abf69 100644 --- a/src/components/chat/chat.js +++ b/src/components/chat/chat.js @@ -204,9 +204,9 @@ const Chat = { } }, readChat () { - if (!(this.currentChatMessageService && this.currentChatMessageService.lastMessage)) { return } + if (!(this.currentChatMessageService && this.currentChatMessageService.maxId)) { return } if (document.hidden) { return } - const lastReadId = this.currentChatMessageService.lastMessage.id + const lastReadId = this.currentChatMessageService.maxId this.$store.dispatch('readChat', { id: this.currentChat.id, lastReadId }) }, bottomedOut (offset) { @@ -244,7 +244,7 @@ const Chat = { const chatId = chatMessageService.chatId const fetchOlderMessages = !!maxId - const sinceId = fetchLatest && chatMessageService.lastMessage && chatMessageService.lastMessage.id + const sinceId = fetchLatest && chatMessageService.maxId this.backendInteractor.chatMessages({ id: chatId, maxId, sinceId }) .then((messages) => { @@ -303,7 +303,11 @@ const Chat = { return this.backendInteractor.sendChatMessage(params) .then(data => { - this.$store.dispatch('addChatMessages', { chatId: this.currentChat.id, messages: [data] }).then(() => { + this.$store.dispatch('addChatMessages', { + chatId: this.currentChat.id, + messages: [data], + updateMaxId: false + }).then(() => { this.$nextTick(() => { this.handleResize() // When the posting form size changes because of a media attachment, we need an extra resize |
