From 413f2e4825af5af4f7b84bfb0d03616b36fc2220 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 21 Aug 2015 10:03:59 +0930 Subject: [PATCH] Add excerpt for user mentioned notification --- .../js/forum/src/components/PostMentionedNotification.js | 3 +-- .../js/forum/src/components/UserMentionedNotification.js | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/extensions/mentions/js/forum/src/components/PostMentionedNotification.js b/extensions/mentions/js/forum/src/components/PostMentionedNotification.js index ffa114303..ac704a604 100644 --- a/extensions/mentions/js/forum/src/components/PostMentionedNotification.js +++ b/extensions/mentions/js/forum/src/components/PostMentionedNotification.js @@ -1,7 +1,6 @@ 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() { @@ -32,6 +31,6 @@ export default class PostMentionedNotification extends Notification { } excerpt() { - return truncate(this.props.notification.subject().contentPlain(), 100); + return this.props.notification.subject().contentPlain(); } } diff --git a/extensions/mentions/js/forum/src/components/UserMentionedNotification.js b/extensions/mentions/js/forum/src/components/UserMentionedNotification.js index 939d791d7..e45122dc8 100644 --- a/extensions/mentions/js/forum/src/components/UserMentionedNotification.js +++ b/extensions/mentions/js/forum/src/components/UserMentionedNotification.js @@ -1,5 +1,4 @@ import Notification from 'flarum/components/Notification'; -import username from 'flarum/helpers/username'; export default class UserMentionedNotification extends Notification { icon() { @@ -17,4 +16,8 @@ export default class UserMentionedNotification extends Notification { return app.trans('mentions.user_mentioned_notification', {user}); } + + excerpt() { + return this.props.notification.subject().contentPlain(); + } }