Browse Source

Fix profile update not being sent on profile/header picture deletion (#15461)

Fixes #15460

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
closed-social-v3
ThibG 3 years ago
committed by GitHub
parent
commit
4552449c26
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      app/controllers/settings/pictures_controller.rb

+ 6
- 2
app/controllers/settings/pictures_controller.rb View File

@ -7,8 +7,12 @@ module Settings
def destroy
if valid_picture?
msg = I18n.t('generic.changes_saved_msg') if UpdateAccountService.new.call(@account, { @picture => nil, "#{@picture}_remote_url" => '' })
redirect_to settings_profile_path, notice: msg, status: 303
if UpdateAccountService.new.call(@account, { @picture => nil, "#{@picture}_remote_url" => '' })
ActivityPub::UpdateDistributionWorker.perform_async(@account.id)
redirect_to settings_profile_path, notice: I18n.t('generic.changes_saved_msg'), status: 303
else
redirect_to settings_profile_path
end
else
bad_request
end

Loading…
Cancel
Save