From c8764000145cb48b3d8514cc8a74a8a1687dab96 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Wed, 17 Nov 2021 17:49:43 +0300 Subject: [PATCH] Message List: Fix flickering when sending message to an empty channel --- src/components/middle/MessageList.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/middle/MessageList.tsx b/src/components/middle/MessageList.tsx index 50260192..4f6f004f 100644 --- a/src/components/middle/MessageList.tsx +++ b/src/components/middle/MessageList.tsx @@ -275,8 +275,8 @@ const MessageList: FC = ({ } // Loading history while sending a message can return the same message and cause ambiguity - const isFirstMessageLocal = messageIds && messageIds[0] >= LOCAL_MESSAGE_ID_BASE; - if (isFirstMessageLocal) { + const isLastMessageLocal = messageIds && messageIds[messageIds.length - 1] >= LOCAL_MESSAGE_ID_BASE; + if (isLastMessageLocal) { return; }