Skip to content

Commit 7970a8e

Browse files
authored
[QU-309] Do not update last message if message id doesn't match (#47)
1 parent d714b61 commit 7970a8e

File tree

1 file changed

+3
-1
lines changed
  • src/smart-components/ChannelList

1 file changed

+3
-1
lines changed

src/smart-components/ChannelList/utils.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,9 @@ export const pubSubHandler = (pubSub, channelListDispatcher) => {
248248
subScriber.set(topics.UPDATE_USER_MESSAGE, pubSub.subscribe(topics.UPDATE_USER_MESSAGE, (msg) => {
249249
const { channel, message } = msg;
250250
const updatedChannel = channel;
251-
updatedChannel.lastMessage = message;
251+
if (updatedChannel.lastMessage && updatedChannel.lastMessage.messageId === message.messageId) {
252+
updatedChannel.lastMessage = message;
253+
}
252254
if (channel) {
253255
channelListDispatcher({
254256
type: channelActions.ON_LAST_MESSAGE_UPDATED,

0 commit comments

Comments
 (0)