fix: various push notification fixes (#1245)
This commit is contained in:
parent
164768e6c9
commit
3a2c56f0fa
|
@ -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,11 +193,13 @@ 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
|
||||
// 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
|
||||
}
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 505 B |
Binary file not shown.
After Width: | Height: | Size: 905 B |
Loading…
Reference in New Issue