From 706557b9648c5045826e714e715c2d54da96f6bc Mon Sep 17 00:00:00 2001 From: HoonBaek Date: Tue, 26 Oct 2021 11:55:34 +0900 Subject: [PATCH] Do not update last message if message id doesn't match --- src/smart-components/ChannelList/utils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/smart-components/ChannelList/utils.js b/src/smart-components/ChannelList/utils.js index d410ef2dd..644c954ef 100644 --- a/src/smart-components/ChannelList/utils.js +++ b/src/smart-components/ChannelList/utils.js @@ -248,7 +248,9 @@ export const pubSubHandler = (pubSub, channelListDispatcher) => { subScriber.set(topics.UPDATE_USER_MESSAGE, pubSub.subscribe(topics.UPDATE_USER_MESSAGE, (msg) => { const { channel, message } = msg; const updatedChannel = channel; - updatedChannel.lastMessage = message; + if (updatedChannel.lastMessage && updatedChannel.lastMessage.messageId === message.messageId) { + updatedChannel.lastMessage = message; + } if (channel) { channelListDispatcher({ type: channelActions.ON_LAST_MESSAGE_UPDATED,