BUGFIX: not clearing blue notifications correctly when you have a PM

This commit is contained in:
Sam 2014-06-12 10:50:41 +10:00
parent 9bbfb1ea15
commit 8c7363bdd5

View File

@ -5,7 +5,11 @@ class NotificationsController < ApplicationController
def index def index
notifications = Notification.recent_report(current_user, 10) notifications = Notification.recent_report(current_user, 10)
current_user.saw_notification_id(notifications.first.id) if notifications.present? if notifications.present?
# ordering can be off due to PMs
max_id = notifications.map(&:id).max
current_user.saw_notification_id(max_id)
end
current_user.reload current_user.reload
current_user.publish_notifications_state current_user.publish_notifications_state