Set unread notifications badge on app icon
This commit is contained in:
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user