diff options
author | Dorra <dorra.jaoued7@gmail.com> | 2024-06-27 09:45:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-27 09:45:31 +0200 |
commit | bc2426fb94a7bf7d90d643dd4d52d459dd067904 (patch) | |
tree | d865edc1c46a9f533a2fd58769ac01d4cc591415 /src | |
parent | 2dbce993a7c50725b1c2d27b11b32e804705b729 (diff) | |
parent | aff48e0c75207362253dc1ffaabc352256061bc4 (diff) |
Merge pull request #12584 from nextcloud/fix/read-marker
fix(MessagesList): fix unread marker when it is attached to the last message in collapsed group
Diffstat (limited to 'src')
-rw-r--r-- | src/components/MessagesList/MessagesList.vue | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/components/MessagesList/MessagesList.vue b/src/components/MessagesList/MessagesList.vue index 9219b006a..16cd6b972 100644 --- a/src/components/MessagesList/MessagesList.vue +++ b/src/components/MessagesList/MessagesList.vue @@ -919,7 +919,7 @@ export default { // When the current message is not visible (reaction or expired) // we use the next message from the list start the scroller-visibility check - if (!el) { + if (!el || el.offsetParent === null) { const messageId = this.$store.getters.getFirstDisplayableMessageIdAfterReadMarker(this.token, this.conversation.lastReadMessage) el = document.getElementById('message_' + messageId) } @@ -967,6 +967,18 @@ export default { let el = document.getElementById('message_' + this.visualLastReadMessageId) if (el) { el = el.closest('.message') + if (el === null || el.offsetParent === null) { + // Exception: when the message remains not visible + // e.g: it is the last message in collapsed group + // unread marker is set to the combined system message. + // Look for the unread marker itself + el = document.querySelector('.new-message-marker') + if (el) { + el = el.closest('.message') + } else { + console.warn('Visual last read message element not found') + } + } } return el |