summaryrefslogtreecommitdiffstats
path: root/webapp/components/msg_typing.jsx
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-03-31 12:11:29 -0400
committerChristopher Speller <crspeller@gmail.com>2016-03-31 12:11:29 -0400
commit42857295504348c920bc87b855eac148bb61b066 (patch)
tree1d01b56cc61beeb48e4f03150b07b36775e80ca2 /webapp/components/msg_typing.jsx
parent5feda3559106e9d1f156fe25761c1a8c7c21db26 (diff)
downloadchat-42857295504348c920bc87b855eac148bb61b066.tar.gz
chat-42857295504348c920bc87b855eac148bb61b066.tar.bz2
chat-42857295504348c920bc87b855eac148bb61b066.zip
Fixing typing message on channel switch
Diffstat (limited to 'webapp/components/msg_typing.jsx')
-rw-r--r--webapp/components/msg_typing.jsx12
1 files changed, 7 insertions, 5 deletions
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;