Use author avatar on notification

This commit is contained in:
Karina Kwiatek 2022-12-26 00:19:52 +00:00
parent a67c26d985
commit 2d6f539dfd
2 changed files with 2 additions and 1 deletions

View File

@ -38,6 +38,7 @@ class Inbox < ApplicationRecord
question.user.profile.safe_name
end
),
icon: question.author_is_anonymous ? "/icons/maskable_icon_x128.png" : question.user.profile_picture.url(:small),
body: question.content
}
end

View File

@ -6,7 +6,7 @@ self.addEventListener('push', function (event) {
event.waitUntil(self.registration.showNotification(notification.title, {
body: notification.body,
tag: notification.type,
icon: "/icons/maskable_icon_x128.png"
icon: notification.icon,
}));
} else {
console.error("Push event received, but it didn't contain any data.", event);