mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 01:56:58 +08:00
UX: adds chat send shortcut user preference (#30473)
Users can now decide if they want to send a message on: - <kbd>enter</kbd> - <kbd>meta + enter</kbd> If you choose <kbd>meta + enter</kbd>, <kbd>enter</kbd> will add a linebreak. <img width="192" alt="Screenshot 2025-01-21 at 12 57 48" src="https://github.com/user-attachments/assets/abfd6f8b-83b3-4e6f-be67-8f63d536ca8a" />
This commit is contained in:
@ -61,6 +61,7 @@ after_initialize do
|
||||
UserUpdater::OPTION_ATTR.push(:chat_email_frequency)
|
||||
UserUpdater::OPTION_ATTR.push(:chat_header_indicator_preference)
|
||||
UserUpdater::OPTION_ATTR.push(:chat_separate_sidebar_mode)
|
||||
UserUpdater::OPTION_ATTR.push(:chat_send_shortcut)
|
||||
|
||||
register_reviewable_type Chat::ReviewableMessage
|
||||
|
||||
@ -246,6 +247,10 @@ after_initialize do
|
||||
object.chat_separate_sidebar_mode
|
||||
end
|
||||
|
||||
add_to_serializer(:user_option, :chat_send_shortcut) { object.chat_send_shortcut }
|
||||
|
||||
add_to_serializer(:current_user_option, :chat_send_shortcut) { object.chat_send_shortcut }
|
||||
|
||||
on(:site_setting_changed) do |name, old_value, new_value|
|
||||
user_option_field = Chat::RETENTION_SETTINGS_TO_USER_OPTION_FIELDS[name.to_sym]
|
||||
begin
|
||||
|
Reference in New Issue
Block a user