Message: Fix incorrect replies display (#3314)

This commit is contained in:
Alexander Zinchuk 2023-06-18 12:03:22 +02:00
parent 0812ddecad
commit 23a65bcd0d
3 changed files with 5 additions and 5 deletions

View File

@ -288,7 +288,7 @@ const MessageList: FC<OwnProps & StateProps> = ({
}, [messageIds, messagesById, threadFirstMessageId, threadTopMessageId, type, isServiceNotificationsChat]); }, [messageIds, messagesById, threadFirstMessageId, threadTopMessageId, type, isServiceNotificationsChat]);
useInterval(() => { useInterval(() => {
if (!messageIds || !messagesById) { if (!messageIds || !messagesById || type === 'scheduled') {
return; return;
} }
const ids = messageIds.filter((id) => messagesById[id]?.reactions); const ids = messageIds.filter((id) => messagesById[id]?.reactions);
@ -299,7 +299,7 @@ const MessageList: FC<OwnProps & StateProps> = ({
}, MESSAGE_REACTIONS_POLLING_INTERVAL); }, MESSAGE_REACTIONS_POLLING_INTERVAL);
useInterval(() => { useInterval(() => {
if (!messageIds || !messagesById || threadId !== MAIN_THREAD_ID) { if (!messageIds || !messagesById || threadId !== MAIN_THREAD_ID || type === 'scheduled') {
return; return;
} }
const ids = messageIds.filter((id) => messagesById[id]?.repliesThreadInfo?.isComments const ids = messageIds.filter((id) => messagesById[id]?.repliesThreadInfo?.isComments

View File

@ -223,7 +223,7 @@ const MessageListContent: FC<OwnProps> = ({
threadId={threadId} threadId={threadId}
messageListType={type} messageListType={type}
noComments={noComments} noComments={noComments}
noReplies={!noComments || threadId !== MAIN_THREAD_ID} noReplies={!noComments || threadId !== MAIN_THREAD_ID || type === 'scheduled'}
appearanceOrder={messageCountToAnimate - ++appearanceIndex} appearanceOrder={messageCountToAnimate - ++appearanceIndex}
isJustAdded={position.isLastInList && isNewMessage} isJustAdded={position.isLastInList && isNewMessage}
isFirstInGroup={position.isFirstInGroup} isFirstInGroup={position.isFirstInGroup}

View File

@ -56,7 +56,7 @@ import {
selectTabState, selectTabState,
} from '../../selectors'; } from '../../selectors';
import { import {
getMessageContent, isUserId, isMessageLocal, getMessageText, checkIfHasUnreadReactions, getMessageContent, isUserId, isMessageLocal, getMessageText, checkIfHasUnreadReactions, isActionMessage,
} from '../../helpers'; } from '../../helpers';
import { onTickEnd } from '../../../util/schedulers'; import { onTickEnd } from '../../../util/schedulers';
import { updateUnreadReactions } from '../../reducers/reactions'; import { updateUnreadReactions } from '../../reducers/reactions';
@ -810,7 +810,7 @@ function updateListedAndViewportIds<T extends GlobalState>(
lastMessageId: message.id, lastMessageId: message.id,
}); });
if (!isMessageLocal(message)) { if (!isMessageLocal(message) && !isActionMessage(message)) {
global = updateThreadInfo(global, chatId, threadInfo.threadId, { global = updateThreadInfo(global, chatId, threadInfo.threadId, {
messagesCount: (threadInfo.messagesCount || 0) + 1, messagesCount: (threadInfo.messagesCount || 0) + 1,
}); });