Autofix Rubocop Style/IfUnlessModifier (#23697)

This commit is contained in:
Nick Schonning 2023-02-18 06:37:47 -05:00 committed by GitHub
parent 9ab2a775c9
commit e2a3ebb271
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 55 additions and 271 deletions

View file

@ -151,9 +151,7 @@ module AccountInteractions
remove_potential_friendship(other_account)
# When toggling a mute between hiding and allowing notifications, the mute will already exist, so the find_or_create_by! call will return the existing Mute without updating the hide_notifications attribute. Therefore, we check that hide_notifications? is what we want and set it if it isn't.
if mute.hide_notifications? != notifications
mute.update!(hide_notifications: notifications)
end
mute.update!(hide_notifications: notifications) if mute.hide_notifications? != notifications
mute
end

View file

@ -56,9 +56,7 @@ module Omniauthable
user = User.new(user_params_from_auth(email, auth))
begin
if /\A#{URI::DEFAULT_PARSER.make_regexp(%w(http https))}\z/.match?(auth.info.image)
user.account.avatar_remote_url = auth.info.image
end
user.account.avatar_remote_url = auth.info.image if /\A#{URI::DEFAULT_PARSER.make_regexp(%w(http https))}\z/.match?(auth.info.image)
rescue Mastodon::UnexpectedResponseError
user.account.avatar_remote_url = nil
end