Forum: Do not open a list of messages when clicking on the forum (#2428)

This commit is contained in:
Alexander Zinchuk 2023-01-30 15:55:43 +01:00
parent 81bcd32f81
commit 6e5211d742

View File

@ -125,6 +125,7 @@ const Chat: FC<OwnProps & StateProps> = ({
openChat,
focusLastMessage,
loadTopics,
openForumPanel,
} = getActions();
const { isMobile } = useAppLayout();
@ -155,12 +156,17 @@ const Chat: FC<OwnProps & StateProps> = ({
});
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();