summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDorraJaouad <dorra.jaoued7@gmail.com>2024-06-26 23:54:00 +0200
committerDorraJaouad <dorra.jaoued7@gmail.com>2024-06-26 23:54:00 +0200
commitaff48e0c75207362253dc1ffaabc352256061bc4 (patch)
treea6daf3d424906fe9285a297bcd05bab76587b786 /src
parent03a3e631112d6f7ff9903521cf031fdf5478d79c (diff)
fix(MessagesList): fix unread marker when it is attached to the last message in collapsed group
Signed-off-by: DorraJaouad <dorra.jaoued7@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/components/MessagesList/MessagesList.vue14
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