Follow-up
This commit is contained in:
parent
15d04b83a8
commit
cfb3291d1c
@ -25,10 +25,10 @@ import {
|
|||||||
import { throttle } from '../../../util/schedulers';
|
import { throttle } from '../../../util/schedulers';
|
||||||
|
|
||||||
const TYPING_STATUS_CLEAR_DELAY = 6000; // 6 seconds
|
const TYPING_STATUS_CLEAR_DELAY = 6000; // 6 seconds
|
||||||
|
|
||||||
// Enough to animate and mark as read in Message List
|
// Enough to animate and mark as read in Message List
|
||||||
const CURRENT_CHAT_UNREAD_DELAY = 1500;
|
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) => {
|
addReducer('apiUpdate', (global, actions, update: ApiUpdate) => {
|
||||||
switch (update['@type']) {
|
switch (update['@type']) {
|
||||||
@ -83,6 +83,8 @@ addReducer('apiUpdate', (global, actions, update: ApiUpdate) => {
|
|||||||
case 'updateChatInbox': {
|
case 'updateChatInbox': {
|
||||||
setGlobal(updateChat(global, update.id, update.chat));
|
setGlobal(updateChat(global, update.id, update.chat));
|
||||||
|
|
||||||
|
runThrottledForUpdateAppBadge(() => updateAppBadge(selectCountNotMutedUnread(getGlobal())));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user