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]);
useEffect(
() => (content !== LeftColumnContent.ChatList || (isFirstChatFolderActive && !isChatOpen)
() => (content !== LeftColumnContent.ChatList || (isFirstChatFolderActive && !isChatOpen && !isForumPanelOpen)
? captureEscKeyListener(() => handleReset())
: undefined),
[isFirstChatFolderActive, content, handleReset, isChatOpen],
[isFirstChatFolderActive, content, handleReset, isChatOpen, isForumPanelOpen],
);
const handleHotkeySearch = useCallback((e: KeyboardEvent) => {