mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
This reverts commit 002c676344.
Perf regression, we will redo it.
This commit is contained in:
@@ -608,9 +608,7 @@ 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)
|
||||
serializer = ActiveModel::ArraySerializer.new(
|
||||
report, each_serializer: TopicTrackingStateSerializer, scope: guardian
|
||||
)
|
||||
serializer = ActiveModel::ArraySerializer.new(report, each_serializer: TopicTrackingStateSerializer)
|
||||
store_preloaded("topicTrackingStates", MultiJson.dump(serializer))
|
||||
end
|
||||
|
||||
|
||||
@@ -919,7 +919,7 @@ class TopicsController < ApplicationController
|
||||
topic_ids = params[:topic_ids].map { |t| t.to_i }
|
||||
elsif params[:filter] == 'unread'
|
||||
tq = TopicQuery.new(current_user)
|
||||
topics = TopicQuery.unread_filter(tq.joined_topic_user, staff: guardian.is_staff?).listable_topics
|
||||
topics = TopicQuery.unread_filter(tq.joined_topic_user, current_user.id, staff: guardian.is_staff?).listable_topics
|
||||
topics = TopicQuery.tracked_filter(topics, current_user.id) if params[:tracked].to_s == "true"
|
||||
|
||||
if params[:category_id]
|
||||
|
||||
@@ -308,9 +308,7 @@ class UsersController < ApplicationController
|
||||
guardian.ensure_can_edit!(user)
|
||||
|
||||
report = TopicTrackingState.report(user)
|
||||
serializer = ActiveModel::ArraySerializer.new(
|
||||
report, each_serializer: TopicTrackingStateSerializer, scope: guardian
|
||||
)
|
||||
serializer = ActiveModel::ArraySerializer.new(report, each_serializer: TopicTrackingStateSerializer)
|
||||
|
||||
render json: MultiJson.dump(serializer)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user