Add avatar_url so we always get an avatar even when the user hasn't set one
This commit is contained in:
committed by
Rosa Gutierrez
parent
6ec3cc6f2c
commit
113e61d418
@@ -31,7 +31,7 @@ class Notification::PushTarget::Native < Notification::PushTarget
|
||||
body: payload.body,
|
||||
url: payload.url,
|
||||
account_id: notification.account.external_account_id,
|
||||
avatar_url: creator_avatar_url,
|
||||
avatar_url: payload.avatar_url,
|
||||
card_id: card&.id,
|
||||
card_title: card&.title,
|
||||
creator_name: notification.creator.name,
|
||||
@@ -50,10 +50,4 @@ class Notification::PushTarget::Native < Notification::PushTarget
|
||||
def interruption_level
|
||||
payload.high_priority? ? "time-sensitive" : "active"
|
||||
end
|
||||
|
||||
def creator_avatar_url
|
||||
if notification.creator.respond_to?(:avatar) && notification.creator.avatar.attached?
|
||||
Rails.application.routes.url_helpers.url_for(notification.creator.avatar)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user