From 8f60d8d2c79064736bac2aa8bc101984ba69af27 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 10 Jan 2022 12:53:37 +0000 Subject: [PATCH] Consider continuations when resolving whether a tile is last in section (#7461) --- src/components/structures/MessagePanel.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/structures/MessagePanel.tsx b/src/components/structures/MessagePanel.tsx index 7112f1318ed..4e9723a3a40 100644 --- a/src/components/structures/MessagePanel.tsx +++ b/src/components/structures/MessagePanel.tsx @@ -727,12 +727,14 @@ export default class MessagePanel extends React.Component { ret.push(dateSeparator); } - let willWantDateSeparator = false; let lastInSection = true; if (nextEventWithTile) { - willWantDateSeparator = this.wantsDateSeparator(mxEv, nextEventWithTile.getDate() || new Date()); - lastInSection = willWantDateSeparator || mxEv.getSender() !== nextEventWithTile.getSender() || - getEventDisplayInfo(nextEventWithTile).isInfoMessage; + const nextEv = nextEventWithTile; + const willWantDateSeparator = this.wantsDateSeparator(mxEv, nextEv.getDate() || new Date()); + lastInSection = willWantDateSeparator || + mxEv.getSender() !== nextEv.getSender() || + getEventDisplayInfo(nextEv).isInfoMessage || + !shouldFormContinuation(mxEv, nextEv, this.showHiddenEvents, this.context.timelineRenderingType); } // is this a continuation of the previous message?