From 265af195dabec22713f935e4278ec48466e8a567 Mon Sep 17 00:00:00 2001 From: hippoz <10706925-hippoz@users.noreply.gitlab.com> Date: Tue, 20 Sep 2022 22:52:41 +0300 Subject: [PATCH] show date marker at start of channels --- frontend/src/stores.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/stores.js b/frontend/src/stores.js index 9a214a9..d31729d 100644 --- a/frontend/src/stores.js +++ b/frontend/src/stores.js @@ -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;