fix: show proper notification text for follow request (#2314)

Fixes #1800
This commit is contained in:
Nolan Lawson 2022-12-11 12:01:01 -08:00 committed by GitHub
parent 040462f5b5
commit b1dc43a9c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 1 deletions

View file

@ -497,6 +497,7 @@ export default {
}: {description}`,
accountFollowedYou: '{name} followed you, {account}',
accountSignedUp: '{name} signed up, {account}',
accountRequestedFollow: '{name} requested to follow you, {account}',
reblogCountsHidden: 'Boost counts hidden',
favoriteCountsHidden: 'Favorite counts hidden',
rebloggedTimes: `Boosted {count, plural,
@ -512,6 +513,7 @@ export default {
favoritedYou: 'favorited your toot',
followedYou: 'followed you',
edited: 'edited their toot',
requestedFollow: 'requested to follow you',
signedUp: 'signed up',
posted: 'posted',
pollYouCreatedEnded: 'A poll you created has ended',

View file

@ -66,7 +66,7 @@ export async function getTimeline (instanceName, accessToken, timeline, maxId, s
}
if (timeline === 'notifications/mentions') {
params.exclude_types = ['follow', 'favourite', 'reblog', 'poll', 'admin.sign_up']
params.exclude_types = ['follow', 'favourite', 'reblog', 'poll', 'admin.sign_up', 'update', 'follow_request']
}
url += '?' + paramsString(params)

View file

@ -76,6 +76,8 @@
}
if (notificationType === 'admin.sign_up') {
return formatIntl('intl.accountSignedUp', params)
} else if (notificationType === 'follow_request') {
return formatIntl('intl.accountRequestedFollow', params)
} else { // 'follow'
return formatIntl('intl.accountFollowedYou', params)
}

View file

@ -139,6 +139,8 @@
return '#fa-user-plus'
} else if (notificationType === 'update') {
return '#fa-pencil'
} else if (notificationType === 'follow_request') {
return '#fa-hourglass'
}
return '#fa-star'
},
@ -163,6 +165,8 @@
return 'intl.reblogged'
} else if (notificationType === 'update') {
return 'intl.edited'
} else if (notificationType === 'follow_request') {
return 'intl.requestedFollow'
} else {
return ''
}

View file

@ -215,6 +215,7 @@ async function showRichNotification (data, notification) {
switch (notification.type) {
case 'follow':
case 'follow_request':
case 'admin.sign_up': {
await self.registration.showNotification(data.title, {
badge,