From 985944466a1c7bbd4f6646a6af9c65fdcde31e86 Mon Sep 17 00:00:00 2001 From: Hamish Peebles Date: Thu, 14 Jan 2021 09:35:32 +0000 Subject: [PATCH] Add DayChangeMarker where suitable before unconfirmed messages (#57) --- src/website/public/components/MessagesList.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/website/public/components/MessagesList.tsx b/src/website/public/components/MessagesList.tsx index 8cd26a86d1..b94b1e49c4 100644 --- a/src/website/public/components/MessagesList.tsx +++ b/src/website/public/components/MessagesList.tsx @@ -38,6 +38,10 @@ function MessagesList() { continue; } else if (message.kind === "unconfirmed") { const now = new Date(); + const dayString = now.toDateString(); + if (lastSeenDayString === null || lastSeenDayString !== dayString) { + children.push(); + } const mergeWithPrevious: boolean = lastSeenDate !== null && @@ -49,12 +53,14 @@ function MessagesList() { mergeWithPrevious }; children.push(); - prevMessageSender = myUserId; + lastSeenDate = now; + lastSeenDayString = dayString; + prevMessageSender = myUserId; } else { const dayString = message.date.toDateString(); if (lastSeenDayString === null || lastSeenDayString !== dayString) { - children.push(); + children.push(); } const mergeWithPrevious: boolean =