Autofix Rubocop Style/IfUnlessModifier (#23697)
This commit is contained in:
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user