mirror of
https://github.com/flarum/framework.git
synced 2025-02-18 12:33:22 +08:00
Update both unread and new notification count when a new notification appears
Related to flarum/core#500.
This commit is contained in:
parent
d5cc7494b0
commit
f5c9fd5d8d
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user