From 91d91d1e853d03cf4e4221ad6a49fd8e774fe9e2 Mon Sep 17 00:00:00 2001 From: zubiden <19638254+zubiden@users.noreply.github.com> Date: Wed, 14 May 2025 19:01:58 +0300 Subject: [PATCH] Service Notifications: Update unread counter on new one (#5890) --- src/global/actions/apiUpdaters/chats.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/global/actions/apiUpdaters/chats.ts b/src/global/actions/apiUpdaters/chats.ts index 90ee2f8aa..4792da8d1 100644 --- a/src/global/actions/apiUpdaters/chats.ts +++ b/src/global/actions/apiUpdaters/chats.ts @@ -2,7 +2,7 @@ import type { ApiMessage, ApiUpdateChat } from '../../../api/types'; import type { ActionReturnType } from '../../types'; import { MAIN_THREAD_ID } from '../../../api/types'; -import { ARCHIVED_FOLDER_ID, MAX_ACTIVE_PINNED_CHATS } from '../../../config'; +import { ARCHIVED_FOLDER_ID, MAX_ACTIVE_PINNED_CHATS, SERVICE_NOTIFICATIONS_USER_ID } from '../../../config'; import { buildCollectionByKey, omit } from '../../../util/iteratees'; import { isLocalMessageId } from '../../../util/keys/messageKey'; import { closeMessageNotifications, notifyAboutMessage } from '../../../util/notifications'; @@ -171,7 +171,7 @@ addActionHandler('apiUpdate', (global, actions, update): ActionReturnType => { const hasMention = Boolean(update.message.id && update.message.hasUnreadMention); - if (!isLocal) { + if (!isLocal || chat.id === SERVICE_NOTIFICATIONS_USER_ID) { global = updateChat(global, update.chatId, { unreadCount: chat.unreadCount ? chat.unreadCount + 1 : 1, });