From 7c95df2766994028d6ca4564615a80efe889020c Mon Sep 17 00:00:00 2001
From: nickago <ngonella@calpoly.edu>
Date: Fri, 3 Jul 2015 13:04:06 -0700
Subject: Force the extra info to update asych

---
 web/react/components/channel_header.jsx | 7 +++++++
 1 file changed, 7 insertions(+)

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

diff --git a/web/react/components/channel_header.jsx b/web/react/components/channel_header.jsx
index 48cb4d13b..68de80228 100644
--- a/web/react/components/channel_header.jsx
+++ b/web/react/components/channel_header.jsx
@@ -4,6 +4,7 @@
 var ChannelStore = require('../stores/channel_store.jsx');
 var UserStore = require('../stores/user_store.jsx');
 var PostStore = require('../stores/post_store.jsx');
+var SocketStore = require('../stores/socket_store.jsx')
 var UserProfile = require( './user_profile.jsx' );
 var NavbarSearchBox =require('./search_bar.jsx');
 var AsyncClient = require('../utils/async_client.jsx');
@@ -82,6 +83,7 @@ module.exports = React.createClass({
         ChannelStore.addExtraInfoChangeListener(this._onChange);
         PostStore.addSearchChangeListener(this._onChange);
         UserStore.addChangeListener(this._onChange);
+        SocketStore.addChangeListener(this._onSocketChange);
     },
     componentWillUnmount: function() {
         ChannelStore.removeChangeListener(this._onChange);
@@ -96,6 +98,11 @@ module.exports = React.createClass({
         }
         $(".channel-header__info .description").popover({placement : 'bottom', trigger: 'hover', html: true, delay: {show: 500, hide: 500}});
     },
+    _onSocketChange: function(msg) {
+        if(msg.action === "new_user") {
+            AsyncClient.getChannelExtraInfo(true);
+        }
+    },
     getInitialState: function() {
         return getStateFromStores();
     },
-- 
cgit v1.2.3-1-g7c22

