mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-08 17:16:25 +01:00
Better copy for interactions on replies
This commit is contained in:
parent
95f71115d4
commit
aede10d71e
1 changed files with 21 additions and 4 deletions
|
@ -39,14 +39,17 @@ const contentText = {
|
||||||
mention: 'mentioned you in their post.',
|
mention: 'mentioned you in their post.',
|
||||||
status: 'published a post.',
|
status: 'published a post.',
|
||||||
reblog: 'boosted your post.',
|
reblog: 'boosted your post.',
|
||||||
|
reblog_reply: 'boosted your reply.',
|
||||||
follow: 'followed you.',
|
follow: 'followed you.',
|
||||||
follow_request: 'requested to follow you.',
|
follow_request: 'requested to follow you.',
|
||||||
favourite: 'favourited your post.',
|
favourite: 'favourited your post.',
|
||||||
|
favourite_reply: 'favourited your reply.',
|
||||||
poll: 'A poll you have voted in or created has ended.',
|
poll: 'A poll you have voted in or created has ended.',
|
||||||
'poll-self': 'A poll you have created has ended.',
|
'poll-self': 'A poll you have created has ended.',
|
||||||
'poll-voted': 'A poll you have voted in has ended.',
|
'poll-voted': 'A poll you have voted in has ended.',
|
||||||
update: 'A post you interacted with has been edited.',
|
update: 'A post you interacted with has been edited.',
|
||||||
'favourite+reblog': 'boosted & favourited your post.',
|
'favourite+reblog': 'boosted & favourited your post.',
|
||||||
|
'favourite+reblog_reply': 'boosted & favourited your reply.',
|
||||||
};
|
};
|
||||||
|
|
||||||
function Notification({ notification, instance, reload }) {
|
function Notification({ notification, instance, reload }) {
|
||||||
|
@ -59,6 +62,10 @@ function Notification({ notification, instance, reload }) {
|
||||||
const currentAccount = store.session.get('currentAccount');
|
const currentAccount = store.session.get('currentAccount');
|
||||||
const isSelf = currentAccount === account?.id;
|
const isSelf = currentAccount === account?.id;
|
||||||
const isVoted = status?.poll?.voted;
|
const isVoted = status?.poll?.voted;
|
||||||
|
const isReplyToOthers =
|
||||||
|
!!status?.inReplyToAccountId &&
|
||||||
|
status?.inReplyToAccountId !== currentAccount &&
|
||||||
|
status?.account?.id === currentAccount;
|
||||||
|
|
||||||
let favsCount = 0;
|
let favsCount = 0;
|
||||||
let reblogsCount = 0;
|
let reblogsCount = 0;
|
||||||
|
@ -75,10 +82,20 @@ function Notification({ notification, instance, reload }) {
|
||||||
if (!favsCount && reblogsCount) type = 'reblog';
|
if (!favsCount && reblogsCount) type = 'reblog';
|
||||||
}
|
}
|
||||||
|
|
||||||
const text =
|
let text;
|
||||||
type === 'poll'
|
if (type === 'poll') {
|
||||||
? contentText[isSelf ? 'poll-self' : isVoted ? 'poll-voted' : 'poll']
|
text = contentText[isSelf ? 'poll-self' : isVoted ? 'poll-voted' : 'poll'];
|
||||||
: contentText[type];
|
} else if (
|
||||||
|
type === 'reblog' ||
|
||||||
|
type === 'favourite' ||
|
||||||
|
type === 'favourite+reblog'
|
||||||
|
) {
|
||||||
|
text =
|
||||||
|
contentText[isReplyToOthers ? `${type}_reply` : type] ||
|
||||||
|
contentText[type];
|
||||||
|
} else {
|
||||||
|
text = contentText[type];
|
||||||
|
}
|
||||||
|
|
||||||
if (type === 'mention' && !status) {
|
if (type === 'mention' && !status) {
|
||||||
// Could be deleted
|
// Could be deleted
|
||||||
|
|
Loading…
Reference in a new issue