From 6c0fefad152e1843bccf80fb675301b789f70dd5 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Mon, 10 Aug 2015 14:47:45 -0400 Subject: added getChannelCounts service and refactored the client to more intelligently pull channel data --- web/react/components/sidebar.jsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'web/react/components/sidebar.jsx') 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); } -- cgit v1.2.3-1-g7c22