fix: show proper text for signup notifications (#2182)
This commit is contained in:
parent
0fd7154ed4
commit
1c6387a0a4
|
@ -495,6 +495,7 @@ export default {
|
||||||
other {video}
|
other {video}
|
||||||
}: {description}`,
|
}: {description}`,
|
||||||
accountFollowedYou: '{name} followed you, {account}',
|
accountFollowedYou: '{name} followed you, {account}',
|
||||||
|
accountSignedUp: '{name} signed up, {account}',
|
||||||
reblogCountsHidden: 'Boost counts hidden',
|
reblogCountsHidden: 'Boost counts hidden',
|
||||||
favoriteCountsHidden: 'Favorite counts hidden',
|
favoriteCountsHidden: 'Favorite counts hidden',
|
||||||
rebloggedTimes: `Boosted {count, plural,
|
rebloggedTimes: `Boosted {count, plural,
|
||||||
|
@ -509,6 +510,7 @@ export default {
|
||||||
rebloggedYou: 'boosted your toot',
|
rebloggedYou: 'boosted your toot',
|
||||||
favoritedYou: 'favorited your toot',
|
favoritedYou: 'favorited your toot',
|
||||||
followedYou: 'followed you',
|
followedYou: 'followed you',
|
||||||
|
signedUp: 'signed up',
|
||||||
posted: 'posted',
|
posted: 'posted',
|
||||||
pollYouCreatedEnded: 'A poll you created has ended',
|
pollYouCreatedEnded: 'A poll you created has ended',
|
||||||
pollYouVotedEnded: 'A poll you voted on has ended',
|
pollYouVotedEnded: 'A poll you voted on has ended',
|
||||||
|
|
|
@ -58,6 +58,7 @@
|
||||||
account: ({ notification }) => notification.account,
|
account: ({ notification }) => notification.account,
|
||||||
accountId: ({ account }) => account.id,
|
accountId: ({ account }) => account.id,
|
||||||
notificationId: ({ notification }) => notification.id,
|
notificationId: ({ notification }) => notification.id,
|
||||||
|
notificationType: ({ notification }) => notification.type,
|
||||||
status: ({ notification }) => notification.status,
|
status: ({ notification }) => notification.status,
|
||||||
statusId: ({ status }) => status && status.id,
|
statusId: ({ status }) => status && status.id,
|
||||||
uuid: ({ $currentInstance, timelineType, timelineValue, notificationId, statusId }) => (
|
uuid: ({ $currentInstance, timelineType, timelineValue, notificationId, statusId }) => (
|
||||||
|
@ -65,12 +66,20 @@
|
||||||
),
|
),
|
||||||
elementId: ({ uuid }) => uuid,
|
elementId: ({ uuid }) => uuid,
|
||||||
shortcutScope: ({ elementId }) => elementId,
|
shortcutScope: ({ elementId }) => elementId,
|
||||||
ariaLabel: ({ status, account, $omitEmojiInDisplayNames }) => (
|
ariaLabel: ({ status, account, $omitEmojiInDisplayNames, notificationType }) => {
|
||||||
!status && formatIntl('intl.accountFollowedYou', {
|
if (status) {
|
||||||
|
return undefined // aria-label not needed if there's a status
|
||||||
|
}
|
||||||
|
const params = {
|
||||||
name: getAccountAccessibleName(account, $omitEmojiInDisplayNames),
|
name: getAccountAccessibleName(account, $omitEmojiInDisplayNames),
|
||||||
account: `@${account.acct}`
|
account: `@${account.acct}`
|
||||||
})
|
}
|
||||||
),
|
if (notificationType === 'admin.sign_up') {
|
||||||
|
return formatIntl('intl.accountSignedUp', params)
|
||||||
|
} else { // 'follow'
|
||||||
|
return formatIntl('intl.accountFollowedYou', params)
|
||||||
|
}
|
||||||
|
},
|
||||||
className: ({ $underlineLinks }) => (classname(
|
className: ({ $underlineLinks }) => (classname(
|
||||||
'notification-article',
|
'notification-article',
|
||||||
'shortcut-list-item',
|
'shortcut-list-item',
|
||||||
|
|
|
@ -127,6 +127,8 @@
|
||||||
return '#fa-bar-chart'
|
return '#fa-bar-chart'
|
||||||
} else if (notificationType === 'status') {
|
} else if (notificationType === 'status') {
|
||||||
return '#fa-comment'
|
return '#fa-comment'
|
||||||
|
} else if (notificationType === 'admin.sign_up') {
|
||||||
|
return '#fa-user-plus'
|
||||||
}
|
}
|
||||||
return '#fa-star'
|
return '#fa-star'
|
||||||
},
|
},
|
||||||
|
@ -135,6 +137,8 @@
|
||||||
return 'intl.rebloggedYou'
|
return 'intl.rebloggedYou'
|
||||||
} else if (notificationType === 'favourite') {
|
} else if (notificationType === 'favourite') {
|
||||||
return 'intl.favoritedYou'
|
return 'intl.favoritedYou'
|
||||||
|
} else if (notificationType === 'admin.sign_up') {
|
||||||
|
return 'intl.signedUp'
|
||||||
} else if (notificationType === 'follow') {
|
} else if (notificationType === 'follow') {
|
||||||
return 'intl.followedYou'
|
return 'intl.followedYou'
|
||||||
} else if (notificationType === 'status') {
|
} else if (notificationType === 'status') {
|
||||||
|
|
|
@ -200,7 +200,8 @@ async function showRichNotification (data, notification) {
|
||||||
const badge = '/icon-push-badge.png'
|
const badge = '/icon-push-badge.png'
|
||||||
|
|
||||||
switch (notification.type) {
|
switch (notification.type) {
|
||||||
case 'follow': {
|
case 'follow':
|
||||||
|
case 'admin.sign_up': {
|
||||||
await self.registration.showNotification(data.title, {
|
await self.registration.showNotification(data.title, {
|
||||||
badge,
|
badge,
|
||||||
icon,
|
icon,
|
||||||
|
|
Loading…
Reference in a new issue