flarum / framework

Simple forum software for building great communities.
http://flarum.org/
6.23k stars 830 forks source link

[Pusher] New notifications count increment doesnt work #3969

Open clownishthorn opened 4 months ago

clownishthorn commented 4 months ago

Current Behavior

Unread notifications count doesn't update on events

Steps to Reproduce

  1. Log-in (to be able to subscribe to private channel) and go to any page
  2. Receive new pusher notification (post in discussion you are subscribed to; new private discussion; etc)
  3. Notifications count doesnt update untill the page is refreshed

Expected Behavior

Unread notifications count should increment by 1 with each notification

Screenshots

No response

Environment

Output of php flarum info

No response

Possible Solution

https://github.com/flarum/framework/blob/1.x/extensions/pusher/js/src/forum/index.tsx#L152C12-L153C84

Replace in those 2 lines: app.session.user.unreadNotificationCount() ?? 0 + 1 to (app.session.user.unreadNotificationCount() ?? 0) + 1 app.session.user.newNotificationCount() ?? 0 + 1 to (app.session.user.newNotificationCount() ?? 0) + 1

Additional Context

No response