mirror of
https://github.com/flarum/core.git
synced 2025-08-03 06:57:54 +02:00
Update both unread and new notification count when a new notification appears
Related to flarum/core#500.
This commit is contained in:
@@ -138,7 +138,8 @@ app.initializers.add('pusher', () => {
|
|||||||
if (channels.user) {
|
if (channels.user) {
|
||||||
channels.user.bind('notification', () => {
|
channels.user.bind('notification', () => {
|
||||||
app.session.user.pushAttributes({
|
app.session.user.pushAttributes({
|
||||||
unreadNotificationsCount: app.session.user.unreadNotificationsCount() + 1
|
unreadNotificationsCount: app.session.user.unreadNotificationsCount() + 1,
|
||||||
|
newNotificationsCount: app.session.user.newNotificationsCount() + 1
|
||||||
});
|
});
|
||||||
delete app.cache.notifications;
|
delete app.cache.notifications;
|
||||||
m.redraw();
|
m.redraw();
|
||||||
|
Reference in New Issue
Block a user