mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-01-23 00:56:23 +01:00
Fix handling of admin.report notification
This is untested, may break.
This commit is contained in:
parent
f2f7b7fe1f
commit
ab1b34d4d2
1 changed files with 11 additions and 3 deletions
|
@ -58,14 +58,14 @@ const contentText = {
|
||||||
'favourite+reblog+account': (count) =>
|
'favourite+reblog+account': (count) =>
|
||||||
`boosted & favourited ${count} of your posts.`,
|
`boosted & favourited ${count} of your posts.`,
|
||||||
'favourite+reblog_reply': 'boosted & favourited your reply.',
|
'favourite+reblog_reply': 'boosted & favourited your reply.',
|
||||||
'admin.report': 'reported a post.',
|
|
||||||
'admin.sign_up': 'signed up.',
|
'admin.sign_up': 'signed up.',
|
||||||
|
'admin.report': (targetAccount) => <>reported {targetAccount}</>,
|
||||||
};
|
};
|
||||||
|
|
||||||
const AVATARS_LIMIT = 50;
|
const AVATARS_LIMIT = 50;
|
||||||
|
|
||||||
function Notification({ notification, instance, reload, isStatic }) {
|
function Notification({ notification, instance, reload, isStatic }) {
|
||||||
const { id, status, account, _accounts, _statuses } = notification;
|
const { id, status, account, report, _accounts, _statuses } = notification;
|
||||||
let { type } = notification;
|
let { type } = notification;
|
||||||
|
|
||||||
// status = Attached when type of the notification is favourite, reblog, status, mention, poll, or update
|
// status = Attached when type of the notification is favourite, reblog, status, mention, poll, or update
|
||||||
|
@ -119,7 +119,15 @@ function Notification({ notification, instance, reload, isStatic }) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof text === 'function') {
|
if (typeof text === 'function') {
|
||||||
text = text(_statuses?.length || _accounts?.length);
|
const count = _statuses?.length || _accounts?.length;
|
||||||
|
if (count) {
|
||||||
|
text = text(count);
|
||||||
|
} else if (type === 'admin.report') {
|
||||||
|
const targetAccount = report?.targetAccount;
|
||||||
|
if (targetAccount) {
|
||||||
|
text = text(<NameText account={targetAccount} showAvatar />);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type === 'mention' && !status) {
|
if (type === 'mention' && !status) {
|
||||||
|
|
Loading…
Reference in a new issue