0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-09 21:45:25 +08:00
discourse/app/serializers/current_user_option_serializer.rb
Renato Atilio 3566029f69
UX: Always show the "Mark unread" topic button (#42189)
Previously, the button was hidden behind both a
`default_other_enable_defer` site setting and a per-user `enable_defer`
preference, which defaulted to off, so most sites never exposed it.

This change removes both settings and always shows the button — and its
bulk-select counterpart — to logged-in users.

Note that `enable_defer` also disappears from the user API response
(`UserOptionSerializer`, `CurrentUserOptionSerializer`). The
`user_options.enable_defer` column is retained and added to
`ignored_columns`; dropping it is left to a follow-up PR once this has
shipped, matching the existing entries in that list.
2026-08-04 10:29:12 -03:00

49 lines
1.4 KiB
Ruby
Vendored

# frozen_string_literal: true
class CurrentUserOptionSerializer < ApplicationSerializer
attributes :mailing_list_mode,
:external_links_in_new_tab,
:enable_quoting,
:enable_smart_lists,
:enable_markdown_monospace_font,
:dynamic_favicon,
:automatically_unpin_topics,
:likes_notifications_disabled,
:hide_profile_and_presence,
:hide_profile,
:hide_presence,
:title_count_mode,
:timezone,
:skip_new_user_tips,
:default_calendar,
:bookmark_auto_delete_preference,
:notify_on_linked_posts,
:seen_popups,
:should_be_redirected_to_top,
:redirected_to_top,
:treat_as_new_topic_start_date,
:sidebar_link_to_filtered_list,
:sidebar_show_count_of_new_items,
:composition_mode,
:interface_color_mode,
:show_original_content,
:send_shortcut,
:automatically_translate,
:understood_languages
def likes_notifications_disabled
object.likes_notifications_disabled?
end
def show_original_content
!object.automatically_translate
end
def include_redirected_to_top?
object.redirected_to_top.present?
end
def include_seen_popups?
SiteSetting.enable_user_tips
end
end