mirror of
https://github.com/thelounge/thelounge
synced 2024-11-26 14:00:21 +00:00
Fix unread markers not rendering with hidden status messages
Co-Authored-By: Richard Lewis <richrd@users.noreply.github.com>
This commit is contained in:
parent
395be41728
commit
b3e86dbab4
1 changed files with 8 additions and 6 deletions
|
@ -24,7 +24,7 @@
|
|||
:key="message.id + '-date'"
|
||||
:message="message" />
|
||||
<div
|
||||
v-if="shouldDisplayUnreadMarker(id)"
|
||||
v-if="shouldDisplayUnreadMarker(message.id)"
|
||||
:key="message.id + '-unread'"
|
||||
class="unread-marker">
|
||||
<span class="unread-marker-text" />
|
||||
|
@ -188,6 +188,9 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
beforeUpdate() {
|
||||
this.unreadMarkerShown = false;
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.$root.$off("resize", this.handleResize);
|
||||
this.$refs.chat.removeEventListener("scroll", this.debouncedScroll);
|
||||
|
@ -208,13 +211,12 @@ export default {
|
|||
return (new Date(previousMessage.time)).getDay() !== (new Date(message.time)).getDay();
|
||||
},
|
||||
shouldDisplayUnreadMarker(id) {
|
||||
const previousMessage = this.condensedMessages[id - 1];
|
||||
|
||||
if (!previousMessage) {
|
||||
return false;
|
||||
if (!this.unreadMarkerShown && id > this.channel.firstUnread) {
|
||||
this.unreadMarkerShown = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
return this.channel.firstUnread === previousMessage.id;
|
||||
return false;
|
||||
},
|
||||
onCopy() {
|
||||
clipboard(this.$el);
|
||||
|
|
Loading…
Reference in a new issue