mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Remove legacy user menu (#21308)
This commit is contained in:
@@ -279,7 +279,6 @@ class Notification < ActiveRecord::Base
|
||||
notifications.to_a
|
||||
end
|
||||
|
||||
# TODO(osama): deprecate this method when redesigned_user_menu_enabled is removed
|
||||
def self.recent_report(user, count = nil, types = [])
|
||||
return unless user && user.user_option
|
||||
|
||||
|
||||
@@ -762,7 +762,7 @@ class User < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def reviewable_count
|
||||
Reviewable.list_for(self, include_claimed_by_others: !redesigned_user_menu_enabled?).count
|
||||
Reviewable.list_for(self, include_claimed_by_others: false).count
|
||||
end
|
||||
|
||||
def saw_notification_id(notification_id)
|
||||
@@ -869,13 +869,9 @@ class User < ActiveRecord::Base
|
||||
seen_notification_id: seen_notification_id,
|
||||
}
|
||||
|
||||
if self.redesigned_user_menu_enabled?
|
||||
payload[:all_unread_notifications_count] = all_unread_notifications_count
|
||||
payload[:grouped_unread_notifications] = grouped_unread_notifications
|
||||
payload[
|
||||
:new_personal_messages_notifications_count
|
||||
] = new_personal_messages_notifications_count
|
||||
end
|
||||
payload[:all_unread_notifications_count] = all_unread_notifications_count
|
||||
payload[:grouped_unread_notifications] = grouped_unread_notifications
|
||||
payload[:new_personal_messages_notifications_count] = new_personal_messages_notifications_count
|
||||
|
||||
MessageBus.publish("/notification/#{id}", payload, user_ids: [id])
|
||||
end
|
||||
@@ -1828,10 +1824,6 @@ class User < ActiveRecord::Base
|
||||
user_status && !user_status.expired?
|
||||
end
|
||||
|
||||
def redesigned_user_menu_enabled?
|
||||
!SiteSetting.legacy_navigation_menu? || SiteSetting.enable_new_notifications_menu
|
||||
end
|
||||
|
||||
def new_new_view_enabled?
|
||||
in_any_groups?(SiteSetting.experimental_new_new_view_groups_map)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user