mirror of
https://github.com/discourse/discourse.git
synced 2025-01-30 06:28:03 +08:00
FIX: PWA badges were not updating (#15191)
That regressed in #7714, over two years ago. :P
This commit is contained in:
parent
03f3d79388
commit
d3912075b6
|
@ -13,15 +13,12 @@ export default {
|
|||
return;
|
||||
} // must be logged in
|
||||
|
||||
this.notifications =
|
||||
user.unread_notifications + user.unread_high_priority_notifications;
|
||||
const appEvents = container.lookup("service:app-events");
|
||||
appEvents.on("notifications:changed", () => {
|
||||
const notifications =
|
||||
user.unread_notifications + user.unread_high_priority_notifications;
|
||||
|
||||
container
|
||||
.lookup("service:app-events")
|
||||
.on("notifications:changed", this, "_updateBadge");
|
||||
},
|
||||
|
||||
_updateBadge() {
|
||||
navigator.setAppBadge(this.notifications);
|
||||
navigator.setAppBadge(notifications);
|
||||
});
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user