From ae2fc6bd690f5becdd39842fa6c2fe5b01381192 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Sat, 7 Jan 2023 04:04:40 +0100 Subject: [PATCH] Forum Panel: Fix switching forums --- src/components/left/main/ForumPanel.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/left/main/ForumPanel.tsx b/src/components/left/main/ForumPanel.tsx index 77b2b0b54..f32813b48 100644 --- a/src/components/left/main/ForumPanel.tsx +++ b/src/components/left/main/ForumPanel.tsx @@ -11,7 +11,7 @@ import { GENERAL_TOPIC_ID, TOPICS_SLICE, TOPIC_HEIGHT_PX, TOPIC_LIST_SENSITIVE_AREA, } from '../../../config'; -import { selectChat, selectCurrentMessageList } from '../../../global/selectors'; +import { selectChat, selectCurrentMessageList, selectIsForumPanelOpen } from '../../../global/selectors'; import buildClassName from '../../../util/buildClassName'; import { getOrderedTopics } from '../../../global/helpers'; import captureEscKeyListener from '../../../util/captureEscKeyListener'; @@ -237,9 +237,9 @@ const ForumPanel: FC = ({ export default memo(withGlobal( (global, ownProps, detachWhenChanged): StateProps => { - const chatId = global.forumPanelChatId; - detachWhenChanged(chatId); + detachWhenChanged(selectIsForumPanelOpen(global)); + const chatId = global.forumPanelChatId; const chat = chatId ? selectChat(global, chatId) : undefined; const { chatId: currentChatId,