Add option to disable real-time updates in web UI (#9984)

Fix #9031
Fix #7913
This commit is contained in:
Eugen Rochko
2019-07-16 06:30:47 +02:00
committed by GitHub
parent 4562c3cb7e
commit 9b1d3e4acb
20 changed files with 181 additions and 70 deletions

View File

@ -35,6 +35,7 @@ class UserSettingsDecorator
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')
user.settings['use_pending_items'] = use_pending_items_preference if change?('setting_use_pending_items')
end
def merged_notification_emails
@ -117,6 +118,10 @@ class UserSettingsDecorator
boolean_cast_setting 'setting_use_blurhash'
end
def use_pending_items_preference
boolean_cast_setting 'setting_use_pending_items'
end
def boolean_cast_setting(key)
ActiveModel::Type::Boolean.new.cast(settings[key])
end