From 2b2dcb2f896320a2c9590021a47f8c5288695242 Mon Sep 17 00:00:00 2001 From: MM20 <15646950+MM2-0@users.noreply.github.com> Date: Sat, 2 Apr 2022 12:32:23 +0200 Subject: [PATCH] Distinct notificationy by shortcutId to calculate badge count --- .../launcher2/badges/providers/NotificationBadgeProvider.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/badges/src/main/java/de/mm20/launcher2/badges/providers/NotificationBadgeProvider.kt b/badges/src/main/java/de/mm20/launcher2/badges/providers/NotificationBadgeProvider.kt index 79762755..a37bf69a 100644 --- a/badges/src/main/java/de/mm20/launcher2/badges/providers/NotificationBadgeProvider.kt +++ b/badges/src/main/java/de/mm20/launcher2/badges/providers/NotificationBadgeProvider.kt @@ -26,7 +26,7 @@ class NotificationBadgeProvider : BadgeProvider, KoinComponent { send(null) } else { val badge = Badge( - number = it.sumOf { + number = it.distinctBy { it.notification.shortcutId }.sumOf { if(it.notification.shortcutId == null) 0 else it.notification.number },