From 3086c645fde2345d34e401bdf3e2f19f19da3294 Mon Sep 17 00:00:00 2001 From: ThibG Date: Wed, 26 Jun 2019 19:33:04 +0200 Subject: Add option to disable blurhash previews (#11188) * Add option to disable blurhash previews * Update option text * Change options order --- app/lib/user_settings_decorator.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/lib') diff --git a/app/lib/user_settings_decorator.rb b/app/lib/user_settings_decorator.rb index bf2e5a962..aaf95cc19 100644 --- a/app/lib/user_settings_decorator.rb +++ b/app/lib/user_settings_decorator.rb @@ -34,6 +34,7 @@ class UserSettingsDecorator user.settings['aggregate_reblogs'] = aggregate_reblogs_preference if change?('setting_aggregate_reblogs') user.settings['show_application'] = show_application_preference if change?('setting_show_application') user.settings['advanced_layout'] = advanced_layout_preference if change?('setting_advanced_layout') + user.settings['use_blurhash'] = use_blurhash_preference if change?('setting_use_blurhash') end def merged_notification_emails @@ -112,6 +113,10 @@ class UserSettingsDecorator boolean_cast_setting 'setting_advanced_layout' end + def use_blurhash_preference + boolean_cast_setting 'setting_use_blurhash' + end + def boolean_cast_setting(key) ActiveModel::Type::Boolean.new.cast(settings[key]) end -- cgit