From ea80836c6e0acc4fe871024aab04ceba045bdcad Mon Sep 17 00:00:00 2001
From: hmhealey <harrisonmhealey@gmail.com>
Date: Thu, 3 Dec 2015 12:57:34 -0500
Subject: Removed some internal state from ChannelMembersModal and
 ChannelInviteModal

---
 web/react/components/channel_members_modal.jsx | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

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

diff --git a/web/react/components/channel_members_modal.jsx b/web/react/components/channel_members_modal.jsx
index c7276e60e..d1b9df988 100644
--- a/web/react/components/channel_members_modal.jsx
+++ b/web/react/components/channel_members_modal.jsx
@@ -69,16 +69,9 @@ export default class ChannelMembersModal extends React.Component {
         memberList.sort(compareByUsername);
         nonmemberList.sort(compareByUsername);
 
-        const channel = ChannelStore.getCurrent();
-        let channelName = '';
-        if (channel) {
-            channelName = channel.display_name;
-        }
-
         return {
             nonmemberList,
-            memberList,
-            channelName
+            memberList
         };
     }
     onShow() {
@@ -169,7 +162,7 @@ export default class ChannelMembersModal extends React.Component {
                     onHide={this.props.onModalDismissed}
                 >
                     <Modal.Header closeButton={true}>
-                        <Modal.Title><span className='name'>{this.state.channelName}</span>{' Members'}</Modal.Title>
+                        <Modal.Title><span className='name'>{this.props.channel.display_name}</span>{' Members'}</Modal.Title>
                         <a
                             className='btn btn-md btn-primary'
                             href='#'
@@ -206,6 +199,7 @@ export default class ChannelMembersModal extends React.Component {
                 <ChannelInviteModal
                     show={this.state.showInviteModal}
                     onHide={() => this.setState({showInviteModal: false})}
+                    channel={this.props.channel}
                 />
             </div>
         );
@@ -218,5 +212,6 @@ ChannelMembersModal.defaultProps = {
 
 ChannelMembersModal.propTypes = {
     show: React.PropTypes.bool.isRequired,
-    onModalDismissed: React.PropTypes.func.isRequired
+    onModalDismissed: React.PropTypes.func.isRequired,
+    channel: React.PropTypes.object.isRequired
 };
-- 
cgit v1.2.3-1-g7c22

