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 e891b84
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 class="messages-group__date" :key="dateSeparatorLabels[dateTimestamp]">

Check warning on line 28 in src/components/MessagesList/MessagesList.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Attribute ":key" should go before "class"
<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 e891b84

Please sign in to comment.