diff --git a/src/sw.ts b/src/sw.ts index 3c6ffaac..15a55479 100644 --- a/src/sw.ts +++ b/src/sw.ts @@ -141,6 +141,13 @@ const handlePushNotificationEventData = async (eventData: PushMessageData) => { } catch (e) { // Likely Firefox/Gecko-based and doesn't support badging API } + if (pushData.unread == 0) { + self.registration.getNotifications({ tag: "Cinny" }) + .then((notifications) => notifications + .forEach((notification) => notification.close())); + await navigator.clearAppBadge(); + return; + } } else { await navigator.clearAppBadge(); }