Automatically dismiss the privacy settings notice when visiting the privacy settings page

This commit is contained in:
Claire 2023-09-13 12:23:01 +02:00
parent 3f361c2bf2
commit 54580fb33d

View File

@ -3,9 +3,13 @@
class Settings::PrivacyController < Settings::BaseController
before_action :set_account
def show; end
def show
Notice.find(:mastodon_privacy_4_2).dismiss_for_user!(@account.user) # rubocop:disable Naming/VariableNumber
end
def update
Notice.find(:mastodon_privacy_4_2).dismiss_for_user!(@account.user) # rubocop:disable Naming/VariableNumber
if UpdateAccountService.new.call(@account, account_params.except(:settings))
current_user.update!(settings_attributes: account_params[:settings])
ActivityPub::UpdateDistributionWorker.perform_async(@account.id)