Forward Picker: Fix closing when switching to inline bot (#1866)

This commit is contained in:
Alexander Zinchuk 2022-05-16 13:33:57 +02:00
parent 188251f0fb
commit 810f2bdd65

View File

@ -100,6 +100,11 @@ const ForwardPicker: FC<OwnProps & StateProps> = ({
}
}, [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<OwnProps & StateProps> = ({
filter={filter}
onFilterChange={setFilter}
onSelectChatOrUser={handleSelectUser}
onClose={exitForwardMode}
onClose={handleClose}
onCloseAnimationEnd={unmarkIsShown}
/>
);