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.topics = summary.topic_ids.map(id => topicMap[id]);
|
||||||
|
|
||||||
|
if (summary.badges) {
|
||||||
summary.badges = summary.badges.map(ub => {
|
summary.badges = summary.badges.map(ub => {
|
||||||
const badge = badgeMap[ub.badge_id];
|
const badge = badgeMap[ub.badge_id];
|
||||||
badge.count = ub.count;
|
badge.count = ub.count;
|
||||||
return badge;
|
return badge;
|
||||||
});
|
});
|
||||||
|
}
|
||||||
return summary;
|
return summary;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,4 +15,8 @@ class UserSummarySerializer < ApplicationSerializer
|
||||||
attributes :likes_given, :likes_received, :posts_read_count,
|
attributes :likes_given, :likes_received, :posts_read_count,
|
||||||
:days_visited, :topic_count, :post_count
|
:days_visited, :topic_count, :post_count
|
||||||
|
|
||||||
|
|
||||||
|
def include_badges?
|
||||||
|
SiteSetting.enable_badges
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue