From 8c7363bdd5ddeb54f2e759415e97e772a782b360 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 12 Jun 2014 10:50:41 +1000 Subject: [PATCH] BUGFIX: not clearing blue notifications correctly when you have a PM --- app/controllers/notifications_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index cb515169f68..8677493fd3f 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -5,7 +5,11 @@ class NotificationsController < ApplicationController def index 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.publish_notifications_state