Message List: Fix redundant unread mention badge for incoming messages
This commit is contained in:
parent
2f1fc7dadd
commit
cd81c81686
@ -1201,11 +1201,6 @@ addActionHandler('markMentionsRead', (global, actions, payload) => {
|
|||||||
const chat = selectCurrentChat(global);
|
const chat = selectCurrentChat(global);
|
||||||
if (!chat) return;
|
if (!chat) return;
|
||||||
|
|
||||||
if (!chat.unreadMentionsCount) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const unreadMentionsCount = chat.unreadMentionsCount - messageIds.length;
|
|
||||||
const unreadMentions = (chat.unreadMentions || []).filter((id) => !messageIds.includes(id));
|
const unreadMentions = (chat.unreadMentions || []).filter((id) => !messageIds.includes(id));
|
||||||
global = updateChat(global, chat.id, {
|
global = updateChat(global, chat.id, {
|
||||||
unreadMentions,
|
unreadMentions,
|
||||||
@ -1213,13 +1208,6 @@ addActionHandler('markMentionsRead', (global, actions, payload) => {
|
|||||||
|
|
||||||
setGlobal(global);
|
setGlobal(global);
|
||||||
|
|
||||||
if (!unreadMentions.length && unreadMentionsCount) {
|
|
||||||
actions.fetchUnreadMentions({
|
|
||||||
chatId: chat.id,
|
|
||||||
offsetId: Math.max(...messageIds),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
actions.markMessagesRead({ messageIds });
|
actions.markMessagesRead({ messageIds });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user