FEATURE: no need to cap new and unread together anymore

- leave unread alone
- cap new at 500 per site, with a site setting
This commit is contained in:
Sam
2015-10-01 17:17:15 +10:00
parent 9bb7a3884b
commit 6f43b575a8
5 changed files with 2 additions and 38 deletions

View File

@ -300,9 +300,6 @@ class ApplicationController < ActionController::Base
def preload_current_user_data
store_preloaded("currentUser", MultiJson.dump(CurrentUserSerializer.new(current_user, scope: guardian, root: false)))
report = TopicTrackingState.report(current_user.id)
if report.length >= SiteSetting.max_tracked_new_unread.to_i
TopicUser.cap_unread_later(current_user.id)
end
serializer = ActiveModel::ArraySerializer.new(report, each_serializer: TopicTrackingStateSerializer)
store_preloaded("topicTrackingStates", MultiJson.dump(serializer))
end