From 810f2bdd6508e2480081b543719e544fea3149e5 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Mon, 16 May 2022 13:33:57 +0200 Subject: [PATCH] Forward Picker: Fix closing when switching to inline bot (#1866) --- src/components/main/ForwardPicker.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/main/ForwardPicker.tsx b/src/components/main/ForwardPicker.tsx index 4f24e4e5a..af53e19b6 100644 --- a/src/components/main/ForwardPicker.tsx +++ b/src/components/main/ForwardPicker.tsx @@ -100,6 +100,11 @@ const ForwardPicker: FC = ({ } }, [openChatWithText, resetSwitchBotInline, setForwardChatId, switchBotInline]); + const handleClose = useCallback(() => { + exitForwardMode(); + resetSwitchBotInline(); + }, [exitForwardMode, resetSwitchBotInline]); + const renderingChatAndContactIds = useCurrentOrPrev(chatAndContactIds, true)!; if (!isOpen && !isShown) { @@ -116,7 +121,7 @@ const ForwardPicker: FC = ({ filter={filter} onFilterChange={setFilter} onSelectChatOrUser={handleSelectUser} - onClose={exitForwardMode} + onClose={handleClose} onCloseAnimationEnd={unmarkIsShown} /> );