Forum Panel: Close on Esc (#2360)

This commit is contained in:
Alexander Zinchuk 2023-01-28 02:15:32 +01:00
parent 568e98a083
commit e5537cbbc0

View File

@ -332,10 +332,10 @@ const LeftColumn: FC<StateProps> = ({
}, [forumPanelChatId, setGlobalSearchChatId, setGlobalSearchQuery]); }, [forumPanelChatId, setGlobalSearchChatId, setGlobalSearchQuery]);
useEffect( useEffect(
() => (content !== LeftColumnContent.ChatList || (isFirstChatFolderActive && !isChatOpen) () => (content !== LeftColumnContent.ChatList || (isFirstChatFolderActive && !isChatOpen && !isForumPanelOpen)
? captureEscKeyListener(() => handleReset()) ? captureEscKeyListener(() => handleReset())
: undefined), : undefined),
[isFirstChatFolderActive, content, handleReset, isChatOpen], [isFirstChatFolderActive, content, handleReset, isChatOpen, isForumPanelOpen],
); );
const handleHotkeySearch = useCallback((e: KeyboardEvent) => { const handleHotkeySearch = useCallback((e: KeyboardEvent) => {