FIX: don't show badges in summary page if badges disabled
This commit is contained in:
parent
24630f6b54
commit
adbc22530c
|
@ -410,11 +410,13 @@ const User = RestModel.extend({
|
|||
|
||||
summary.topics = summary.topic_ids.map(id => topicMap[id]);
|
||||
|
||||
summary.badges = summary.badges.map(ub => {
|
||||
const badge = badgeMap[ub.badge_id];
|
||||
badge.count = ub.count;
|
||||
return badge;
|
||||
});
|
||||
if (summary.badges) {
|
||||
summary.badges = summary.badges.map(ub => {
|
||||
const badge = badgeMap[ub.badge_id];
|
||||
badge.count = ub.count;
|
||||
return badge;
|
||||
});
|
||||
}
|
||||
return summary;
|
||||
});
|
||||
}
|
||||
|
|
|
@ -15,4 +15,8 @@ class UserSummarySerializer < ApplicationSerializer
|
|||
attributes :likes_given, :likes_received, :posts_read_count,
|
||||
:days_visited, :topic_count, :post_count
|
||||
|
||||
|
||||
def include_badges?
|
||||
SiteSetting.enable_badges
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue