mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 08:03:40 +08:00
FIX: notifications not updating correctly from background tab
We refactored some code to avoid app event leak in tests at c462c2f2
Unfortunately this broke all background notifications in title and they
were broken for the past multiple months.
This commit is contained in:
parent
e9cf0de588
commit
3e855e33ae
|
@ -6,8 +6,7 @@ export default {
|
|||
const user = container.lookup("current-user:main");
|
||||
if (!user) return; // must be logged in
|
||||
|
||||
this.notifications =
|
||||
user.unread_notifications + user.unread_private_messages;
|
||||
this.container = container;
|
||||
|
||||
container
|
||||
.lookup("app-events:main")
|
||||
|
@ -15,6 +14,12 @@ export default {
|
|||
},
|
||||
|
||||
_updateTitle() {
|
||||
Discourse.updateNotificationCount(this.notifications);
|
||||
const user = this.container.lookup("current-user:main");
|
||||
if (!user) return; // must be logged in
|
||||
|
||||
const notifications =
|
||||
user.unread_notifications + user.unread_private_messages;
|
||||
|
||||
Discourse.updateNotificationCount(notifications);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user