Forum: Do not open a list of messages when clicking on the forum (#2428)
This commit is contained in:
parent
81bcd32f81
commit
6e5211d742
@ -125,6 +125,7 @@ const Chat: FC<OwnProps & StateProps> = ({
|
|||||||
openChat,
|
openChat,
|
||||||
focusLastMessage,
|
focusLastMessage,
|
||||||
loadTopics,
|
loadTopics,
|
||||||
|
openForumPanel,
|
||||||
} = getActions();
|
} = getActions();
|
||||||
|
|
||||||
const { isMobile } = useAppLayout();
|
const { isMobile } = useAppLayout();
|
||||||
@ -155,12 +156,17 @@ const Chat: FC<OwnProps & StateProps> = ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const handleClick = useCallback(() => {
|
const handleClick = useCallback(() => {
|
||||||
|
if (isForum) {
|
||||||
|
openForumPanel({ chatId });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
openChat({ id: chatId, shouldReplaceHistory: true }, { forceOnHeavyAnimation: true });
|
openChat({ id: chatId, shouldReplaceHistory: true }, { forceOnHeavyAnimation: true });
|
||||||
|
|
||||||
if (isSelected && canScrollDown) {
|
if (isSelected && canScrollDown) {
|
||||||
focusLastMessage();
|
focusLastMessage();
|
||||||
}
|
}
|
||||||
}, [openChat, chatId, isSelected, canScrollDown, focusLastMessage]);
|
}, [isForum, openChat, chatId, isSelected, canScrollDown, openForumPanel, focusLastMessage]);
|
||||||
|
|
||||||
const handleDragEnter = useCallback((e) => {
|
const handleDragEnter = useCallback((e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user