mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:21:18 +08:00
FIX: remove notifications on deleted topics from the stream
This commit is contained in:
@ -237,7 +237,7 @@ class User < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def unread_notifications_by_type
|
||||
@unread_notifications_by_type ||= notifications.where("id > ? and read = false", seen_notification_id).group(:notification_type).count
|
||||
@unread_notifications_by_type ||= notifications.visible.where("id > ? and read = false", seen_notification_id).group(:notification_type).count
|
||||
end
|
||||
|
||||
def reload
|
||||
@ -248,7 +248,7 @@ class User < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def unread_private_messages
|
||||
@unread_pms ||= notifications.where("read = false AND notification_type = ?", Notification.types[:private_message]).count
|
||||
@unread_pms ||= notifications.visible.where("read = false AND notification_type = ?", Notification.types[:private_message]).count
|
||||
end
|
||||
|
||||
def unread_notifications
|
||||
|
Reference in New Issue
Block a user