From f3b0ae64ff0f277aa87b22a88d8e2c97a81f5fd4 Mon Sep 17 00:00:00 2001
From: JoramWilander <jwawilander@gmail.com>
Date: Thu, 5 Nov 2015 09:39:07 -0500
Subject: Only show * in tab title when a channel is marked unread

---
 web/react/components/sidebar.jsx | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'web/react/components/sidebar.jsx')

diff --git a/web/react/components/sidebar.jsx b/web/react/components/sidebar.jsx
index aab9919a4..0f02003b6 100644
--- a/web/react/components/sidebar.jsx
+++ b/web/react/components/sidebar.jsx
@@ -76,6 +76,8 @@ export default class Sidebar extends React.Component {
             if (ch.type === 'D') {
                 chMentionCount = chUnreadCount;
                 chUnreadCount = 0;
+            } else if (chMember.notify_props && chMember.notify_props.mark_unread === 'mention') {
+                chUnreadCount = 0;
             }
 
             channelUnreadCounts[ch.id] = {msgs: chUnreadCount, mentions: chMentionCount};
@@ -362,7 +364,7 @@ export default class Sidebar extends React.Component {
         var unread = false;
         if (channelMember) {
             msgCount = unreadCount.msgs + unreadCount.mentions;
-            unread = (msgCount > 0 && channelMember.notify_props.mark_unread !== 'mention') || channelMember.mention_count > 0;
+            unread = msgCount > 0 || channelMember.mention_count > 0;
         }
 
         if (unread) {
-- 
cgit v1.2.3-1-g7c22


From d48b305661a2f40cc3e26593fefc7ce7bca6e320 Mon Sep 17 00:00:00 2001
From: JoramWilander <jwawilander@gmail.com>
Date: Thu, 5 Nov 2015 09:42:29 -0500
Subject: Add constant form 'mention'

---
 web/react/components/sidebar.jsx | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'web/react/components/sidebar.jsx')

diff --git a/web/react/components/sidebar.jsx b/web/react/components/sidebar.jsx
index 0f02003b6..8b5f7a381 100644
--- a/web/react/components/sidebar.jsx
+++ b/web/react/components/sidebar.jsx
@@ -20,6 +20,7 @@ const Utils = require('../utils/utils.jsx');
 const Constants = require('../utils/constants.jsx');
 const Preferences = Constants.Preferences;
 const TutorialSteps = Constants.TutorialSteps;
+const NotificationPrefs = Constants.NotificationPrefs;
 
 const Tooltip = ReactBootstrap.Tooltip;
 const OverlayTrigger = ReactBootstrap.OverlayTrigger;
@@ -76,7 +77,7 @@ export default class Sidebar extends React.Component {
             if (ch.type === 'D') {
                 chMentionCount = chUnreadCount;
                 chUnreadCount = 0;
-            } else if (chMember.notify_props && chMember.notify_props.mark_unread === 'mention') {
+            } else if (chMember.notify_props && chMember.notify_props.mark_unread === NotificationPrefs.MENTION) {
                 chUnreadCount = 0;
             }
 
-- 
cgit v1.2.3-1-g7c22

