mirror of
https://github.com/thelounge/thelounge
synced 2024-11-29 23:40:28 +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'"
|
:key="message.id + '-date'"
|
||||||
:message="message" />
|
:message="message" />
|
||||||
<div
|
<div
|
||||||
v-if="shouldDisplayUnreadMarker(id)"
|
v-if="shouldDisplayUnreadMarker(message.id)"
|
||||||
:key="message.id + '-unread'"
|
:key="message.id + '-unread'"
|
||||||
class="unread-marker">
|
class="unread-marker">
|
||||||
<span class="unread-marker-text" />
|
<span class="unread-marker-text" />
|
||||||
|
@ -188,6 +188,9 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
beforeUpdate() {
|
||||||
|
this.unreadMarkerShown = false;
|
||||||
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
this.$root.$off("resize", this.handleResize);
|
this.$root.$off("resize", this.handleResize);
|
||||||
this.$refs.chat.removeEventListener("scroll", this.debouncedScroll);
|
this.$refs.chat.removeEventListener("scroll", this.debouncedScroll);
|
||||||
|
@ -208,13 +211,12 @@ export default {
|
||||||
return (new Date(previousMessage.time)).getDay() !== (new Date(message.time)).getDay();
|
return (new Date(previousMessage.time)).getDay() !== (new Date(message.time)).getDay();
|
||||||
},
|
},
|
||||||
shouldDisplayUnreadMarker(id) {
|
shouldDisplayUnreadMarker(id) {
|
||||||
const previousMessage = this.condensedMessages[id - 1];
|
if (!this.unreadMarkerShown && id > this.channel.firstUnread) {
|
||||||
|
this.unreadMarkerShown = true;
|
||||||
if (!previousMessage) {
|
return true;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.channel.firstUnread === previousMessage.id;
|
return false;
|
||||||
},
|
},
|
||||||
onCopy() {
|
onCopy() {
|
||||||
clipboard(this.$el);
|
clipboard(this.$el);
|
||||||
|
|
Loading…
Reference in a new issue