From a3a64749c53543853e68ea418919600a4bb0836f Mon Sep 17 00:00:00 2001 From: Toby Zerner <toby.zerner@gmail.com> Date: Mon, 19 Oct 2015 15:27:46 +1030 Subject: [PATCH] Only decrease unread count if notification is unread closes #590 --- js/forum/src/components/Notification.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/forum/src/components/Notification.js b/js/forum/src/components/Notification.js index 05b5f1d84..ff8336a75 100644 --- a/js/forum/src/components/Notification.js +++ b/js/forum/src/components/Notification.js @@ -77,7 +77,10 @@ export default class Notification extends Component { * Mark the notification as read. */ markAsRead() { + if (this.props.notification.isRead()) return; + app.session.user.pushAttributes({unreadNotificationsCount: app.session.user.unreadNotificationsCount() - 1}); + this.props.notification.save({isRead: true}); } }