Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Pusher] New notifications count increment doesnt work #3969

Open
clownishthorn opened this issue Feb 29, 2024 · 0 comments
Open

[Pusher] New notifications count increment doesnt work #3969

clownishthorn opened this issue Feb 29, 2024 · 0 comments
Labels

Comments

@clownishthorn
Copy link

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

  • Flarum version: 1.8.3
  • PHP version: 8.1

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant