diff --git a/extensions/mentions/js/forum/src/components/PostMentionedNotification.js b/extensions/mentions/js/forum/src/components/PostMentionedNotification.js index 3b6cd929d..ffa114303 100644 --- a/extensions/mentions/js/forum/src/components/PostMentionedNotification.js +++ b/extensions/mentions/js/forum/src/components/PostMentionedNotification.js @@ -1,6 +1,7 @@ import Notification from 'flarum/components/Notification'; import username from 'flarum/helpers/username'; import punctuate from 'flarum/helpers/punctuate'; +import { truncate } from 'flarum/utils/string'; export default class PostMentionedNotification extends Notification { icon() { @@ -18,7 +19,6 @@ export default class PostMentionedNotification extends Notification { content() { const notification = this.props.notification; - const post = notification.subject(); const auc = notification.additionalUnreadCount(); const user = notification.sender(); @@ -27,8 +27,11 @@ export default class PostMentionedNotification extends Notification { username: auc ? punctuate([ username(user), app.trans('mentions.others', {count: auc}) - ]) : undefined, - number: post.number() + ]) : undefined }); } + + excerpt() { + return truncate(this.props.notification.subject().contentPlain(), 100); + } } diff --git a/extensions/mentions/locale/en.yml b/extensions/mentions/locale/en.yml index 549293222..fafbd1609 100644 --- a/extensions/mentions/locale/en.yml +++ b/extensions/mentions/locale/en.yml @@ -1,6 +1,6 @@ mentions: reply_to_post: "Reply to #{number}" - post_mentioned_notification: "{username} replied to your post #{number}" + post_mentioned_notification: "{username} replied to your post" others: "{count} others" user_mentioned_notification: "{username} mentioned you" post_mentioned_by: "{users} replied to this."