Message List: Fix redundant unread mention badge for incoming messages

This commit is contained in:
Alexander Zinchuk 2022-10-20 17:22:08 +02:00
parent 2f1fc7dadd
commit cd81c81686

View File

@ -1201,11 +1201,6 @@ addActionHandler('markMentionsRead', (global, actions, payload) => {
const chat = selectCurrentChat(global);
if (!chat) return;
if (!chat.unreadMentionsCount) {
return;
}
const unreadMentionsCount = chat.unreadMentionsCount - messageIds.length;
const unreadMentions = (chat.unreadMentions || []).filter((id) => !messageIds.includes(id));
global = updateChat(global, chat.id, {
unreadMentions,
@ -1213,13 +1208,6 @@ addActionHandler('markMentionsRead', (global, actions, payload) => {
setGlobal(global);
if (!unreadMentions.length && unreadMentionsCount) {
actions.fetchUnreadMentions({
chatId: chat.id,
offsetId: Math.max(...messageIds),
});
}
actions.markMessagesRead({ messageIds });
});