Use author avatar on notification
This commit is contained in:
parent
a67c26d985
commit
2d6f539dfd
|
@ -38,6 +38,7 @@ class Inbox < ApplicationRecord
|
||||||
question.user.profile.safe_name
|
question.user.profile.safe_name
|
||||||
end
|
end
|
||||||
),
|
),
|
||||||
|
icon: question.author_is_anonymous ? "/icons/maskable_icon_x128.png" : question.user.profile_picture.url(:small),
|
||||||
body: question.content
|
body: question.content
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,7 +6,7 @@ self.addEventListener('push', function (event) {
|
||||||
event.waitUntil(self.registration.showNotification(notification.title, {
|
event.waitUntil(self.registration.showNotification(notification.title, {
|
||||||
body: notification.body,
|
body: notification.body,
|
||||||
tag: notification.type,
|
tag: notification.type,
|
||||||
icon: "/icons/maskable_icon_x128.png"
|
icon: notification.icon,
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
console.error("Push event received, but it didn't contain any data.", event);
|
console.error("Push event received, but it didn't contain any data.", event);
|
||||||
|
|
Loading…
Reference in New Issue