diff options
author | JoramWilander <jwawilander@gmail.com> | 2015-08-10 14:47:45 -0400 |
---|---|---|
committer | JoramWilander <jwawilander@gmail.com> | 2015-08-11 12:11:35 -0400 |
commit | 6c0fefad152e1843bccf80fb675301b789f70dd5 (patch) | |
tree | e48b601f97cf9f7456e8783082fcb3974691785b /web/react/components/sidebar.jsx | |
parent | 1c0ee4d2f65d1d4434a3a16070abe7d61a268ce6 (diff) | |
download | chat-6c0fefad152e1843bccf80fb675301b789f70dd5.tar.gz chat-6c0fefad152e1843bccf80fb675301b789f70dd5.tar.bz2 chat-6c0fefad152e1843bccf80fb675301b789f70dd5.zip |
added getChannelCounts service and refactored the client to more intelligently pull channel data
Diffstat (limited to 'web/react/components/sidebar.jsx')
-rw-r--r-- | web/react/components/sidebar.jsx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/web/react/components/sidebar.jsx b/web/react/components/sidebar.jsx index fa6302b6d..6ad606e5e 100644 --- a/web/react/components/sidebar.jsx +++ b/web/react/components/sidebar.jsx @@ -157,9 +157,12 @@ module.exports = React.createClass({ onSocketChange: function(msg) { if (msg.action === 'posted') { if (ChannelStore.getCurrentId() === msg.channel_id) { - if (window.isActive) AsyncClient.updateLastViewedAt(); + if (window.isActive) { + AsyncClient.updateLastViewedAt(); + } } else { - AsyncClient.getChannel(msg.channel_id); + console.log('hit'); + AsyncClient.getChannels(); } if (UserStore.getCurrentId() !== msg.user_id) { @@ -213,7 +216,7 @@ module.exports = React.createClass({ utils.ding(); } } - } else if (msg.action === "viewed") { + } else if (msg.action === 'viewed') { if (ChannelStore.getCurrentId() !== msg.channel_id && UserStore.getCurrentId() === msg.user_id) { AsyncClient.getChannel(msg.channel_id); } |