Set unread notifications badge on app icon

This commit is contained in:
Paul Frazee
2023-01-24 17:00:18 -06:00
parent aaef4fcbb8
commit eccb2589c5
+2
View File
@@ -115,6 +115,7 @@ export class MeModel {
clearNotificationCount() { clearNotificationCount() {
this.notificationCount = 0 this.notificationCount = 0
notifee.setBadgeCount(0)
} }
async fetchStateUpdate() { async fetchStateUpdate() {
@@ -122,6 +123,7 @@ export class MeModel {
runInAction(() => { runInAction(() => {
const newNotifications = this.notificationCount !== res.data.count const newNotifications = this.notificationCount !== res.data.count
this.notificationCount = res.data.count this.notificationCount = res.data.count
notifee.setBadgeCount(this.notificationCount)
if (newNotifications) { if (newNotifications) {
// trigger pre-emptive fetch on new notifications // trigger pre-emptive fetch on new notifications
this.notifications.refresh() this.notifications.refresh()