discourse/app/serializers/current_user_option_serializer.rb
Martin Brennan 27bdfb6437
FEATURE: Add user preference to disable smart lists (#29434)
Followup 30fdd7738ec942126bb055c9a6a8d69ddffba2da

Adds a new site setting and corresponding user preference
to disable smart lists. By default they are enabled, because
this is a better experience for most users. A small number of
users would prefer to not have this enabled.

Smart lists automatically append new items to each
list started in the composer when enter is pressed. If
enter is pressed on an empty list item, it is cleared.

This setting will be removed when the new composer is complete.
2024-10-28 14:18:15 +10:00

37 lines
1.0 KiB
Ruby

# frozen_string_literal: true
class CurrentUserOptionSerializer < ApplicationSerializer
attributes :mailing_list_mode,
:external_links_in_new_tab,
:enable_quoting,
:enable_smart_lists,
:dynamic_favicon,
:automatically_unpin_topics,
:likes_notifications_disabled,
:hide_profile_and_presence,
:title_count_mode,
:enable_defer,
:timezone,
:skip_new_user_tips,
:default_calendar,
:bookmark_auto_delete_preference,
: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
def likes_notifications_disabled
object.likes_notifications_disabled?
end
def include_redirected_to_top?
object.redirected_to_top.present?
end
def include_seen_popups?
SiteSetting.enable_user_tips
end
end