Message: Fix redundant focusing to message from sender name

This commit is contained in:
Alexander Zinchuk 2022-01-13 01:11:45 +01:00
parent 9251b468a5
commit 7f74b8cd99
2 changed files with 7 additions and 3 deletions

View File

@ -357,7 +357,8 @@ const Message: FC<OwnProps & StateProps> = ({
chatId,
threadId,
isInDocumentGroup,
Boolean(isScheduled),
asForwarded,
isScheduled,
isRepliesChat,
album,
avatarPeer,

View File

@ -15,6 +15,7 @@ export default function useInnerHandlers(
chatId: string,
threadId: number,
isInDocumentGroup: boolean,
asForwarded?: boolean,
isScheduled?: boolean,
isChatWithRepliesBot?: boolean,
album?: IAlbum,
@ -50,14 +51,16 @@ export default function useInnerHandlers(
return;
}
if (forwardInfo?.channelPostId) {
if (asForwarded && forwardInfo?.channelPostId) {
focusMessage({ chatId: senderPeer.id, messageId: forwardInfo.channelPostId });
} else if (isUserId(senderPeer.id)) {
openUserInfo({ id: senderPeer.id });
} else {
openChat({ id: senderPeer.id });
}
}, [focusMessage, forwardInfo?.channelPostId, lang, openChat, openUserInfo, senderPeer, showNotification]);
}, [
asForwarded, focusMessage, forwardInfo, lang, openChat, openUserInfo, senderPeer, showNotification,
]);
const handleViaBotClick = useCallback(() => {
if (!botSender) {