User
anthonyo
Posted 11 months ago

How to patch pusher not dispatching messages to users in flarum setup:

Manually patch this:
vendor\\flarum\\pusher\\js\\src\\forum\\index.tsx

app.pusher.then((binding: PusherBinding) => {

```
const channels = binding.channels;
if (channels.user) {
channels.user.bind('notification', () => {
if (app.session.user) {
app.session.user.pushAttributes({
//unreadNotificationCount: app.session.user.unreadNotificationCount() ?? 0 + 1,
unreadNotificationCount: (app.session.user.unreadNotificationCount() ?? 0) + 1,
//newNotificationCount: app.session.user.newNotificationCount() ?? 0 + 1,
newNotificationCount: (app.session.user.newNotificationCount() ?? 0) + 1,
});
}
app.notifications.clear();
m.redraw();
});
}
```

});

Image preview

Replies (0)

Please login to post a reply.

Thread Actions
Related Tags