diff options
Diffstat (limited to 'webapp/components')
-rw-r--r-- | webapp/components/more_channels.jsx | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/webapp/components/more_channels.jsx b/webapp/components/more_channels.jsx index 00e7ecf78..b72f9aedd 100644 --- a/webapp/components/more_channels.jsx +++ b/webapp/components/more_channels.jsx @@ -31,10 +31,12 @@ export default class MoreChannels extends React.Component { this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this); - const initState = this.getStateFromStores(); - initState.channelType = ''; - initState.showNewChannelModal = false; - this.state = initState; + this.state = { + channelType: '', + showNewChannelModal: false, + channels: null, + serverError: null + }; } componentDidMount() { @@ -140,31 +142,28 @@ export default class MoreChannels extends React.Component { } let moreChannels; - - if (this.state.channels != null) { - var channels = this.state.channels; - if (channels.loading) { - moreChannels = <LoadingScreen/>; - } else if (channels.length) { - moreChannels = ( - <FilteredChannelList - channels={channels} - handleJoin={this.handleJoin} - /> - ); - } else { - moreChannels = ( - <div className='no-channel-message'> - <p className='primary-message'> - <FormattedMessage - id='more_channels.noMore' - defaultMessage='No more channels to join' - /> - </p> - {createChannelHelpText} - </div> - ); - } + const channels = this.state.channels; + if (channels == null) { + moreChannels = <LoadingScreen/>; + } else if (channels.length) { + moreChannels = ( + <FilteredChannelList + channels={channels} + handleJoin={this.handleJoin} + /> + ); + } else { + moreChannels = ( + <div className='no-channel-message'> + <p className='primary-message'> + <FormattedMessage + id='more_channels.noMore' + defaultMessage='No more channels to join' + /> + </p> + {createChannelHelpText} + </div> + ); } return ( |