From 42857295504348c920bc87b855eac148bb61b066 Mon Sep 17 00:00:00 2001
From: Christopher Speller <crspeller@gmail.com>
Date: Thu, 31 Mar 2016 12:11:29 -0400
Subject: Fixing typing message on channel switch

---
 webapp/components/msg_typing.jsx | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

(limited to 'webapp/components/msg_typing.jsx')

diff --git a/webapp/components/msg_typing.jsx b/webapp/components/msg_typing.jsx
index b2d414287..631eea78d 100644
--- a/webapp/components/msg_typing.jsx
+++ b/webapp/components/msg_typing.jsx
@@ -40,13 +40,15 @@ class MsgTyping extends React.Component {
     }
 
     updateTypingText(typingUsers) {
-        if (!typingUsers) {
-            return;
+        let text = '';
+        let users = {};
+        let numUsers = 0;
+        if (typingUsers) {
+            users = Object.keys(typingUsers);
+            numUsers = users.length;
         }
 
-        const users = Object.keys(typingUsers);
-        let text = '';
-        switch (users.length) {
+        switch (numUsers) {
         case 0:
             text = '';
             break;
-- 
cgit v1.2.3-1-g7c22

