From 06b16467983e63c24bbf60535f88b1b2898e52ed Mon Sep 17 00:00:00 2001 From: David Lu Date: Sat, 4 Jun 2016 08:18:23 -0700 Subject: Changed joiningChannel to id (#3240) --- webapp/components/more_channels.jsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/webapp/components/more_channels.jsx b/webapp/components/more_channels.jsx index 34cad32d2..b0847bd73 100644 --- a/webapp/components/more_channels.jsx +++ b/webapp/components/more_channels.jsx @@ -40,7 +40,7 @@ export default class MoreChannels extends React.Component { var initState = getStateFromStores(); initState.channelType = ''; - initState.joiningChannel = -1; + initState.joiningChannel = ''; initState.showNewChannelModal = false; this.state = initState; } @@ -65,17 +65,17 @@ export default class MoreChannels extends React.Component { this.setState(newState); } } - handleJoin(channel, channelIndex) { - this.setState({joiningChannel: channelIndex}); + handleJoin(channel) { + this.setState({joiningChannel: channel.id}); GlobalActions.emitJoinChannelEvent( channel, () => { $(ReactDOM.findDOMNode(this.refs.modal)).modal('hide'); browserHistory.push(Utils.getTeamURLNoOriginFromAddressBar() + '/channels/' + channel.name); - this.setState({joiningChannel: -1}); + this.setState({joiningChannel: ''}); }, (err) => { - this.setState({joiningChannel: -1, serverError: err.message}); + this.setState({joiningChannel: '', serverError: err.message}); } ); } @@ -83,9 +83,9 @@ export default class MoreChannels extends React.Component { $(ReactDOM.findDOMNode(this.refs.modal)).modal('hide'); this.setState({showNewChannelModal: true}); } - createChannelRow(channel, index) { + createChannelRow(channel) { let joinButton; - if (this.state.joiningChannel === index) { + if (this.state.joiningChannel === channel.id) { joinButton = (