BUGFIX: notifications were not updated correctly live

- missing notifications when multiple replies in topic (till refresh)
- not cleared properly on click
This commit is contained in:
Sam
2014-05-23 11:34:34 +10:00
parent 1fcd72231a
commit e06da1821d
7 changed files with 30 additions and 9 deletions

View File

@ -123,12 +123,7 @@ class Notification < ActiveRecord::Base
protected
def refresh_notification_count
user_id = user.id
MessageBus.publish("/notification/#{user_id}",
{unread_notifications: user.unread_notifications,
unread_private_messages: user.unread_private_messages},
user_ids: [user_id] # only publish the notification to this user
)
user.publish_notifications_state
end
end