From 6e5211d7422fc5f626da138c5e93d09512054716 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Mon, 30 Jan 2023 15:55:43 +0100 Subject: [PATCH] Forum: Do not open a list of messages when clicking on the forum (#2428) --- src/components/left/main/Chat.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/left/main/Chat.tsx b/src/components/left/main/Chat.tsx index ecea176ad..5586f615c 100644 --- a/src/components/left/main/Chat.tsx +++ b/src/components/left/main/Chat.tsx @@ -125,6 +125,7 @@ const Chat: FC = ({ openChat, focusLastMessage, loadTopics, + openForumPanel, } = getActions(); const { isMobile } = useAppLayout(); @@ -155,12 +156,17 @@ const Chat: FC = ({ }); const handleClick = useCallback(() => { + if (isForum) { + openForumPanel({ chatId }); + return; + } + openChat({ id: chatId, shouldReplaceHistory: true }, { forceOnHeavyAnimation: true }); if (isSelected && canScrollDown) { focusLastMessage(); } - }, [openChat, chatId, isSelected, canScrollDown, focusLastMessage]); + }, [isForum, openChat, chatId, isSelected, canScrollDown, openForumPanel, focusLastMessage]); const handleDragEnter = useCallback((e) => { e.preventDefault();