Follow-up

This commit is contained in:
Alexander Zinchuk 2021-08-17 02:54:33 +03:00
parent 15d04b83a8
commit cfb3291d1c

View File

@ -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;
}