From 73891b751b5dc9505d5d0c23345515c37ec2143e Mon Sep 17 00:00:00 2001 From: Alexander Skvortsov Date: Sat, 8 Aug 2020 12:24:47 -0400 Subject: [PATCH] update: forum/components/Notification, forum/components/DiscussionRenamedNotification - Not yet tested --- js/src/forum/components/DiscussionRenamedNotification.js | 8 ++++---- js/src/forum/components/Notification.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/js/src/forum/components/DiscussionRenamedNotification.js b/js/src/forum/components/DiscussionRenamedNotification.js index 02900fbcd..c98732ddb 100644 --- a/js/src/forum/components/DiscussionRenamedNotification.js +++ b/js/src/forum/components/DiscussionRenamedNotification.js @@ -4,9 +4,9 @@ import Notification from './Notification'; * The `DiscussionRenamedNotification` component displays a notification which * indicates that a discussion has had its title changed. * - * ### Props + * ### Attrs * - * - All of the props for Notification + * - All of the attrs for Notification */ export default class DiscussionRenamedNotification extends Notification { icon() { @@ -14,12 +14,12 @@ export default class DiscussionRenamedNotification extends Notification { } href() { - const notification = this.props.notification; + const notification = this.attrs.notification; return app.route.discussion(notification.subject(), notification.content().postNumber); } content() { - return app.translator.trans('core.forum.notifications.discussion_renamed_text', { user: this.props.notification.fromUser() }); + return app.translator.trans('core.forum.notifications.discussion_renamed_text', { user: this.attrs.notification.fromUser() }); } } diff --git a/js/src/forum/components/Notification.js b/js/src/forum/components/Notification.js index 771550dea..2d9016e6f 100644 --- a/js/src/forum/components/Notification.js +++ b/js/src/forum/components/Notification.js @@ -8,7 +8,7 @@ import Button from '../../common/components/Button'; * The `Notification` component abstract displays a single notification. * Subclasses should implement the `icon`, `href`, and `content` methods. * - * ### Props + * ### Attrs * * - `notification` * @@ -16,7 +16,7 @@ import Button from '../../common/components/Button'; */ export default class Notification extends Component { view() { - const notification = this.props.notification; + const notification = this.attrs.notification; const href = this.href(); return ( @@ -86,10 +86,10 @@ export default class Notification extends Component { * Mark the notification as read. */ markAsRead() { - if (this.props.notification.isRead()) return; + if (this.attrs.notification.isRead()) return; app.session.user.pushAttributes({ unreadNotificationCount: app.session.user.unreadNotificationCount() - 1 }); - this.props.notification.save({ isRead: true }); + this.attrs.notification.save({ isRead: true }); } }