Skip to content

Commit

Permalink
fix(MessgaesList): update date separator overnight
Browse files Browse the repository at this point in the history
Signed-off-by: DorraJaouad <[email protected]>
  • Loading branch information
DorraJaouad committed Oct 1, 2024
1 parent 7894b3b commit f91e5dd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/MessagesList/MessagesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
:data-date-timestamp="dateTimestamp"
class="scroller__content"
:class="{ 'has-sticky': dateTimestamp === stickyDate }">
<li class="messages-group__date">
<li :key="dateSeparatorLabels[dateTimestamp]" class="messages-group__date">
<span class="messages-group__date-text" role="heading" aria-level="3">
{{ dateSeparatorLabels[dateTimestamp] }}
</span>
Expand Down Expand Up @@ -390,7 +390,7 @@ export default {
}
if (!this.dateSeparatorLabels[dateTimestamp]) {
this.dateSeparatorLabels[dateTimestamp] = this.generateDateSeparator(dateTimestamp)
this.$set(this.dateSeparatorLabels, dateTimestamp, this.generateDateSeparator(dateTimestamp))
}
if (!groupsByDate[dateTimestamp]) {
Expand Down Expand Up @@ -1266,6 +1266,10 @@ export default {
// setTimeout is needed here for Safari to correctly remove the unread marker
setTimeout(() => {
this.refreshReadMarkerPosition()
// Regenerate relative date separators
Object.keys(this.dateSeparatorLabels).forEach(dateTimestamp => {
this.$set(this.dateSeparatorLabels, dateTimestamp, this.generateDateSeparator(dateTimestamp))
})
}, 2)
},
Expand Down

0 comments on commit f91e5dd

Please sign in to comment.