mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 06:15:28 +08:00
PERF: remove uneeded data, notification count is pointless
Getting notification count is expensive, no point shipping it to clients
This commit is contained in:
parent
f6bc46937b
commit
0b9322d16a
|
@ -170,7 +170,6 @@
|
|||
{{#link-to 'user.notifications'}}
|
||||
{{fa-icon "comment" class="glyph"}}
|
||||
{{i18n 'user.notifications'}}
|
||||
<span class='count'>({{model.notification_count}})</span>
|
||||
{{/link-to}}
|
||||
{{/link-to}}
|
||||
{{/if}}
|
||||
|
|
|
@ -60,7 +60,6 @@ class UserSerializer < BasicUserSerializer
|
|||
:suspended_till,
|
||||
:uploaded_avatar_id,
|
||||
:badge_count,
|
||||
:notification_count,
|
||||
:has_title_badges,
|
||||
:edit_history_public,
|
||||
:custom_fields,
|
||||
|
@ -93,7 +92,6 @@ class UserSerializer < BasicUserSerializer
|
|||
:tracked_category_ids,
|
||||
:watched_category_ids,
|
||||
:private_messages_stats,
|
||||
:notification_count,
|
||||
:disable_jump_reply,
|
||||
:gravatar_avatar_upload_id,
|
||||
:custom_avatar_upload_id,
|
||||
|
@ -292,10 +290,6 @@ class UserSerializer < BasicUserSerializer
|
|||
object.badges.where(allow_title: true).count > 0
|
||||
end
|
||||
|
||||
def notification_count
|
||||
Notification.where(user_id: object.id).count
|
||||
end
|
||||
|
||||
def include_edit_history_public?
|
||||
can_edit && !SiteSetting.edit_history_visible_to_public
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user