From 72e5dc177d8ba1155a401675e862a074ec058f30 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Tue, 18 Jun 2024 16:30:36 +0200 Subject: [PATCH] Composer: Clear draft after sending message in non-main threads (#4692) --- src/components/common/Composer.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/common/Composer.tsx b/src/components/common/Composer.tsx index 86aa8672c..bee36799a 100644 --- a/src/components/common/Composer.tsx +++ b/src/components/common/Composer.tsx @@ -1010,8 +1010,9 @@ const Composer: FC = ({ } lastMessageSendTimeSeconds.current = getServerTime(); - - clearDraft({ chatId, isLocalOnly: true, shouldKeepReply: isForwarding }); + clearDraft({ + chatId, threadId, isLocalOnly: true, shouldKeepReply: isForwarding, + }); if (IS_IOS && messageInput && messageInput === document.activeElement) { applyIosAutoCapitalizationFix(messageInput); @@ -1164,7 +1165,8 @@ const Composer: FC = ({ isSilent, shouldUpdateStickerSetOrder: shouldUpdateStickerSetOrder && canUpdateStickerSetsOrder, }); - clearDraft({ chatId, isLocalOnly: true }); + clearDraft({ chatId, threadId, isLocalOnly: true }); + requestMeasure(() => { resetComposer(shouldPreserveInput); });