From eccb2589c5803faf49039f7bbb5b370db98b306b Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Tue, 24 Jan 2023 17:00:18 -0600 Subject: [PATCH] Set unread notifications badge on app icon --- src/state/models/me.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/state/models/me.ts b/src/state/models/me.ts index 8f20e2865f..3c3bd3d9d3 100644 --- a/src/state/models/me.ts +++ b/src/state/models/me.ts @@ -115,6 +115,7 @@ export class MeModel { clearNotificationCount() { this.notificationCount = 0 + notifee.setBadgeCount(0) } async fetchStateUpdate() { @@ -122,6 +123,7 @@ export class MeModel { runInAction(() => { const newNotifications = this.notificationCount !== res.data.count this.notificationCount = res.data.count + notifee.setBadgeCount(this.notificationCount) if (newNotifications) { // trigger pre-emptive fetch on new notifications this.notifications.refresh()