From 8483f5f73dcc790e080686e2a9108f537621c0d0 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Wed, 1 Jun 2022 00:40:03 +0400 Subject: [PATCH] Follow-up --- src/global/actions/apiUpdaters/messages.ts | 4 ++-- src/global/selectors/messages.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/global/actions/apiUpdaters/messages.ts b/src/global/actions/apiUpdaters/messages.ts index 5eb1386f..e229e4c8 100644 --- a/src/global/actions/apiUpdaters/messages.ts +++ b/src/global/actions/apiUpdaters/messages.ts @@ -47,7 +47,7 @@ import { selectLocalAnimatedEmoji, } from '../../selectors'; import { - getMessageContent, isUserId, isMessageLocal, getMessageText, checkIfHasUnreadReactions, getMessageOriginalId, + getMessageContent, isUserId, isMessageLocal, getMessageText, checkIfHasUnreadReactions, } from '../../helpers'; import { onTickEnd } from '../../../util/schedulers'; import { updateUnreadReactions } from '../../reducers/reactions'; @@ -665,7 +665,7 @@ function updateChatLastMessage( if (currentLastMessage && !force) { const isSameOrNewer = ( - currentLastMessage.id === getMessageOriginalId(message) + currentLastMessage.id === message.id || currentLastMessage.id === message.previousLocalId ) || message.id > currentLastMessage.id; if (!isSameOrNewer) { diff --git a/src/global/selectors/messages.ts b/src/global/selectors/messages.ts index 0262fdab..ca7992e5 100644 --- a/src/global/selectors/messages.ts +++ b/src/global/selectors/messages.ts @@ -311,7 +311,7 @@ export function selectFocusedMessageId(global: GlobalState, chatId: string) { export function selectIsMessageFocused(global: GlobalState, message: ApiMessage) { const focusedId = selectFocusedMessageId(global, message.chatId); - return focusedId ? focusedId === getMessageOriginalId(message) : false; + return focusedId ? focusedId === message.id || focusedId === message.previousLocalId : false; } export function selectIsMessageUnread(global: GlobalState, message: ApiMessage) {