From 6dde48756366008a897bfffdcec6c1756df59ef4 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Mon, 20 May 2024 18:29:16 -0500 Subject: [PATCH] =?UTF-8?q?[=F0=9F=90=B4]=20Prevent=20flash=20upon=20first?= =?UTF-8?q?=20message=20(#4133)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Prevent flash upon first message * set `hasScrolled` to true when sending a message if it isn't already true * revert other change * lint --------- Co-authored-by: Hailey --- src/screens/Messages/Conversation/MessagesList.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/screens/Messages/Conversation/MessagesList.tsx b/src/screens/Messages/Conversation/MessagesList.tsx index cbe037fe..e3035450 100644 --- a/src/screens/Messages/Conversation/MessagesList.tsx +++ b/src/screens/Messages/Conversation/MessagesList.tsx @@ -278,12 +278,16 @@ export function MessagesList({ return true }) + if (!hasScrolled) { + setHasScrolled(true) + } + convoState.sendMessage({ text: rt.text, facets: rt.facets, }) }, - [convoState, getAgent], + [convoState, getAgent, hasScrolled, setHasScrolled], ) // -- List layout changes (opening emoji keyboard, etc.)