fix: Show boost action only for toots with relevant visibility (#584)

This commit is contained in:
Sorin Davidoi 2018-10-28 22:28:55 +00:00 committed by Nolan Lawson
parent bf0eb99fe4
commit c1917318ca
1 changed files with 7 additions and 3 deletions

View File

@ -138,9 +138,6 @@ async function showRichNotification (data, notification) {
const actions = [{
action: 'favourite',
title: 'Favourite'
}, {
action: 'reblog',
title: 'Boost'
}]
if ('reply' in NotificationEvent.prototype) {
@ -151,6 +148,13 @@ async function showRichNotification (data, notification) {
})
}
if (['public', 'unlisted'].includes(notification.status.visibility)) {
actions.push({
action: 'reblog',
title: 'Boost'
})
}
await self.registration.showNotification(data.title, {
icon: data.icon,
body: data.body,