summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorDavid Lu <david.lu@hotmail.com>2016-06-04 08:18:23 -0700
committerJoram Wilander <jwawilander@gmail.com>2016-06-04 11:18:23 -0400
commit06b16467983e63c24bbf60535f88b1b2898e52ed (patch)
treecef05d85827865c1f073f42b6cb0729e65b2d365 /webapp
parentbbaf1032a264d4029e1c0844507e2b59119ef757 (diff)
downloadchat-06b16467983e63c24bbf60535f88b1b2898e52ed.tar.gz
chat-06b16467983e63c24bbf60535f88b1b2898e52ed.tar.bz2
chat-06b16467983e63c24bbf60535f88b1b2898e52ed.zip
Changed joiningChannel to id (#3240)
Diffstat (limited to 'webapp')
-rw-r--r--webapp/components/more_channels.jsx16
1 files 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 = (
<img
className='join-channel-loading-gif'
@@ -95,7 +95,7 @@ export default class MoreChannels extends React.Component {
} else {
joinButton = (
<button
- onClick={this.handleJoin.bind(self, channel, index)}
+ onClick={this.handleJoin.bind(self, channel)}
className='btn btn-primary'
>
<FormattedMessage