From cfb3291d1c3530e0683530fbd57066f13d7b7611 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Tue, 17 Aug 2021 02:54:33 +0300 Subject: [PATCH] Follow-up --- src/modules/actions/apiUpdaters/chats.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/actions/apiUpdaters/chats.ts b/src/modules/actions/apiUpdaters/chats.ts index e6c8e0b0e..1820ee830 100644 --- a/src/modules/actions/apiUpdaters/chats.ts +++ b/src/modules/actions/apiUpdaters/chats.ts @@ -25,10 +25,10 @@ import { import { throttle } from '../../../util/schedulers'; const TYPING_STATUS_CLEAR_DELAY = 6000; // 6 seconds - // Enough to animate and mark as read in Message List const CURRENT_CHAT_UNREAD_DELAY = 1500; -const runThrottledForUpdateAppBadge = throttle((cb) => cb(), CURRENT_CHAT_UNREAD_DELAY, true); + +const runThrottledForUpdateAppBadge = throttle((cb) => cb(), 500, true); addReducer('apiUpdate', (global, actions, update: ApiUpdate) => { switch (update['@type']) { @@ -83,6 +83,8 @@ addReducer('apiUpdate', (global, actions, update: ApiUpdate) => { case 'updateChatInbox': { setGlobal(updateChat(global, update.id, update.chat)); + runThrottledForUpdateAppBadge(() => updateAppBadge(selectCountNotMutedUnread(getGlobal()))); + break; }