mirror of
https://github.com/flarum/core.git
synced 2025-07-26 19:20:21 +02:00
Truncate notification excerpts
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import Notification from 'flarum/components/Notification';
|
import Notification from 'flarum/components/Notification';
|
||||||
|
import { truncate } from 'flarum/utils/string';
|
||||||
|
|
||||||
export default class PostMentionedNotification extends Notification {
|
export default class PostMentionedNotification extends Notification {
|
||||||
icon() {
|
icon() {
|
||||||
@@ -21,6 +22,6 @@ export default class PostMentionedNotification extends Notification {
|
|||||||
}
|
}
|
||||||
|
|
||||||
excerpt() {
|
excerpt() {
|
||||||
return this.props.notification.subject().contentPlain();
|
return truncate(this.props.notification.subject().contentPlain(), 200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
import Notification from 'flarum/components/Notification';
|
import Notification from 'flarum/components/Notification';
|
||||||
|
import { truncate } from 'flarum/utils/string';
|
||||||
|
|
||||||
export default class UserMentionedNotification extends Notification {
|
export default class UserMentionedNotification extends Notification {
|
||||||
icon() {
|
icon() {
|
||||||
@@ -18,6 +19,6 @@ export default class UserMentionedNotification extends Notification {
|
|||||||
}
|
}
|
||||||
|
|
||||||
excerpt() {
|
excerpt() {
|
||||||
return this.props.notification.subject().contentPlain();
|
return truncate(this.props.notification.subject().contentPlain(), 200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user