flarum / flarum/framework

[Pusher] New notifications count increment doesnt work

Open
#3,969 1 comment 2 reactions 0 assignees View on GitHub
type/bug
Dominant language
PHP
Stars
6.7k
Forks
883
Avg merge
15h 16m
Merged PRs (30d)
73

Description

### 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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.