show date marker at start of channels

This commit is contained in:
hippoz 2022-09-20 22:52:41 +03:00
parent 15cdf8033b
commit 265af195da
No known key found for this signature in database
GPG key ID: 7C52899193467641

View file

@ -194,7 +194,7 @@ class MessageStore extends Store {
if (previous && (message._createdAtDate.getTime() - previous._createdAtDate.getTime()) <= 100 * 1000 && message.author_id === previous.author_id) {
message._clumped = true;
}
if (previous && (previous._createdAtDateString !== message._createdAtDateString)) {
if (!previous || (previous._createdAtDateString !== message._createdAtDateString)) {
message._aboveDateMarker = new Intl.DateTimeFormat(getItem("ui:locale"), { month: "long", day: "numeric", year: "numeric" }).format(message._createdAtDate);
}
return message;