about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authorFire Demon <firedemon@creature.cafe>2020-10-28 21:22:04 -0500
committerFire Demon <firedemon@creature.cafe>2020-10-28 21:35:03 -0500
commit3de376650c700be81d893554b90ac8ce27646333 (patch)
treed3b0ca2da8b5f4f4f4cca5e5602293d8f89f50c4 /app/lib
parentf12ad9098f0608f558b92e36b4adeef2e8c28604 (diff)
Make push notifications optional
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/user_settings_decorator.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/lib/user_settings_decorator.rb b/app/lib/user_settings_decorator.rb
index b87635dbc..22601ecaa 100644
--- a/app/lib/user_settings_decorator.rb
+++ b/app/lib/user_settings_decorator.rb
@@ -66,6 +66,7 @@ class UserSettingsDecorator
     user.settings['home_reblogs']        = home_reblogs_preference if change?('setting_home_reblogs')
     user.settings['max_history_public']  = max_history_public_preference if change?('setting_max_history_public')
     user.settings['max_history_private'] = max_history_private_preference if change?('setting_max_history_private')
+    user.settings['web_push']            = web_push_preferences if change?('setting_web_push')
   end
 
   def merged_notification_emails
@@ -256,6 +257,10 @@ class UserSettingsDecorator
     settings['setting_max_history_private'].to_i
   end
 
+  def web_push_preferences
+    boolean_cast_setting 'setting_web_push'
+  end
+
   def boolean_cast_setting(key)
     ActiveModel::Type::Boolean.new.cast(settings[key])
   end