PWA: Update unread counter badge on sync (#1488)
This commit is contained in:
parent
a40f74efa4
commit
8be0c590f9
@ -12,6 +12,7 @@ import {
|
|||||||
} from '../../../config';
|
} from '../../../config';
|
||||||
import { callApi } from '../../../api/gramjs';
|
import { callApi } from '../../../api/gramjs';
|
||||||
import { buildCollectionByKey } from '../../../util/iteratees';
|
import { buildCollectionByKey } from '../../../util/iteratees';
|
||||||
|
import { updateAppBadge } from '../../../util/appBadge';
|
||||||
import {
|
import {
|
||||||
replaceChatListIds,
|
replaceChatListIds,
|
||||||
replaceChats,
|
replaceChats,
|
||||||
@ -23,7 +24,13 @@ import {
|
|||||||
replaceThreadParam,
|
replaceThreadParam,
|
||||||
} from '../../reducers';
|
} from '../../reducers';
|
||||||
import {
|
import {
|
||||||
selectUser, selectChat, selectCurrentMessageList, selectDraft, selectChatMessage, selectThreadInfo,
|
selectUser,
|
||||||
|
selectChat,
|
||||||
|
selectCurrentMessageList,
|
||||||
|
selectDraft,
|
||||||
|
selectChatMessage,
|
||||||
|
selectThreadInfo,
|
||||||
|
selectCountNotMutedUnread,
|
||||||
} from '../../selectors';
|
} from '../../selectors';
|
||||||
import { isChatPrivate } from '../../helpers';
|
import { isChatPrivate } from '../../helpers';
|
||||||
|
|
||||||
@ -75,6 +82,8 @@ async function afterSync(actions: GlobalActions) {
|
|||||||
|
|
||||||
await callApi('fetchCurrentUser');
|
await callApi('fetchCurrentUser');
|
||||||
|
|
||||||
|
updateAppBadge(selectCountNotMutedUnread(getGlobal()));
|
||||||
|
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log('>>> FINISH AFTER-SYNC');
|
console.log('>>> FINISH AFTER-SYNC');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user