From c861a24d48d2cb5417f704eca7d28db7637275f6 Mon Sep 17 00:00:00 2001
From: JoramWilander <jwawilander@gmail.com>
Date: Fri, 12 Feb 2016 14:23:12 -0500
Subject: Fix badge and tab */(1) not disappearing until switching away from
 channel

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

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

diff --git a/web/react/components/channel_loader.jsx b/web/react/components/channel_loader.jsx
index 174c8c4e1..f3000ee05 100644
--- a/web/react/components/channel_loader.jsx
+++ b/web/react/components/channel_loader.jsx
@@ -95,6 +95,8 @@ class ChannelLoader extends React.Component {
 
         $(window).on('focus', function windowFocus() {
             AsyncClient.updateLastViewedAt();
+            ChannelStore.resetCounts(ChannelStore.getCurrentId());
+            ChannelStore.emitChange();
             window.isActive = true;
         });
 
@@ -185,4 +187,4 @@ ChannelLoader.propTypes = {
     intl: intlShape.isRequired
 };
 
-export default injectIntl(ChannelLoader);
\ No newline at end of file
+export default injectIntl(ChannelLoader);
-- 
cgit v1.2.3-1-g7c22

