From 89a1bde1217121fdba248573d031c5133866a495 Mon Sep 17 00:00:00 2001
From: Dmitri Aizenberg <dmitri.aiz@gmail.com>
Date: Thu, 25 Feb 2016 16:22:26 -0800
Subject: fixed

---
 web/react/components/channel_header.jsx | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

(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 727f84e8e..fdef41939 100644
--- a/web/react/components/channel_header.jsx
+++ b/web/react/components/channel_header.jsx
@@ -194,6 +194,17 @@ export default class ChannelHeader extends React.Component {
             );
         }
 
+        const popoverListMembers = [];
+        if (!isDirect) {
+            popoverListMembers.push(
+                <PopoverListMembers
+                    members={this.state.users}
+                    memberCount={this.state.userCount}
+                    channelId={channel.id}
+                />
+               );
+        }
+
         const dropdownContents = [];
         if (isDirect) {
             dropdownContents.push(
@@ -442,11 +453,7 @@ export default class ChannelHeader extends React.Component {
                                 </div>
                             </th>
                             <th>
-                                <PopoverListMembers
-                                    members={this.state.users}
-                                    memberCount={this.state.userCount}
-                                    channelId={channel.id}
-                                />
+                                {popoverListMembers}
                             </th>
                             <th className='search-bar__container'><NavbarSearchBox/></th>
                             <th>
-- 
cgit v1.2.3-1-g7c22


From 5f32b5e80f54e45adbb31decb408d73a10f67efd Mon Sep 17 00:00:00 2001
From: Dmitri Aizenberg <dmitri.aiz@gmail.com>
Date: Fri, 26 Feb 2016 12:02:43 -0800
Subject: minor optimization; following jwilander's recommendation

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

(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 fdef41939..51be13dcf 100644
--- a/web/react/components/channel_header.jsx
+++ b/web/react/components/channel_header.jsx
@@ -194,15 +194,15 @@ export default class ChannelHeader extends React.Component {
             );
         }
 
-        const popoverListMembers = [];
+        let popoverListMembers;
         if (!isDirect) {
-            popoverListMembers.push(
+            popoverListMembers = (
                 <PopoverListMembers
                     members={this.state.users}
                     memberCount={this.state.userCount}
                     channelId={channel.id}
                 />
-               );
+            );
         }
 
         const dropdownContents = [];
-- 
cgit v1.2.3-1-g7c22

