diff --git a/src/service-worker.js b/src/service-worker.js index b1fbed43..31c27c7d 100644 --- a/src/service-worker.js +++ b/src/service-worker.js @@ -162,13 +162,15 @@ async function showRichNotification (data, notification) { case 'mention': const isPublic = ['public', 'unlisted'].includes(notification.status.visibility) const actions = [ - { - action: 'favourite', - title: 'Favorite' - }, isPublic && { action: 'reblog', + icon: '/icon-push-fa-retweet.png', // generated manually from font-awesome-svg title: 'Boost' + }, + { + action: 'favourite', + icon: '/icon-push-fa-star.png', // generated manually from font-awesome-svg + title: 'Favorite' } ].filter(Boolean) @@ -191,10 +193,12 @@ async function showRichNotification (data, notification) { const cloneNotification = notification => { const clone = {} - // Object.assign() does not work with notifications for (let k in notification) { - // intentionally not doing a hasOwnProperty check - clone[k] = notification[k] + // deliberately not doing a hasOwnProperty check, but skipping + // functions and null props like onclick and onshow and showTrigger + if (typeof notification[k] !== 'function' && notification[k] !== null) { + clone[k] = notification[k] + } } return clone diff --git a/static/icon-push-fa-retweet.png b/static/icon-push-fa-retweet.png new file mode 100644 index 00000000..bf9e5773 Binary files /dev/null and b/static/icon-push-fa-retweet.png differ diff --git a/static/icon-push-fa-star.png b/static/icon-push-fa-star.png new file mode 100644 index 00000000..78dfdcee Binary files /dev/null and b/static/icon-push-fa-star.png differ