Preserve notifications when tapping or clearing notifications from a channel (#6209)
This commit is contained in:
parent
bd50422167
commit
3aa0425fdd
1 changed files with 3 additions and 1 deletions
|
|
@ -80,10 +80,12 @@ class PushNotifications {
|
|||
NativeNotifications.removeDeliveredNotifications(ids);
|
||||
}
|
||||
|
||||
let badgeCount = notifications.length - ids.length;
|
||||
|
||||
const serversUrl = Object.keys(DatabaseManager.serverDatabases);
|
||||
const mentionPromises = serversUrl.map((url) => getTotalMentionsForServer(url));
|
||||
Promise.all(mentionPromises).then((result) => {
|
||||
let badgeCount = result.reduce((acc, count) => (acc + count), 0);
|
||||
badgeCount += result.reduce((acc, count) => (acc + count), 0);
|
||||
badgeCount = badgeCount <= 0 ? 0 : badgeCount;
|
||||
Notifications.ios.setBadgeCount(badgeCount);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue