diff options
Diffstat (limited to 'webapp/components/channel_select.jsx')
-rw-r--r-- | webapp/components/channel_select.jsx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/webapp/components/channel_select.jsx b/webapp/components/channel_select.jsx index 59bf2f15a..194de3874 100644 --- a/webapp/components/channel_select.jsx +++ b/webapp/components/channel_select.jsx @@ -31,12 +31,13 @@ export default class ChannelSelect extends React.Component { super(props); this.handleChannelChange = this.handleChannelChange.bind(this); + this.filterChannels = this.filterChannels.bind(this); this.compareByDisplayName = this.compareByDisplayName.bind(this); AsyncClient.getMoreChannels(true); this.state = { - channels: ChannelStore.getAll().sort(this.compareByDisplayName) + channels: ChannelStore.getAll().filter(this.filterChannels).sort(this.compareByDisplayName) }; } @@ -50,10 +51,19 @@ export default class ChannelSelect extends React.Component { handleChannelChange() { this.setState({ - channels: ChannelStore.getAll().concat(ChannelStore.getMoreAll()).sort(this.compareByDisplayName) + channels: ChannelStore.getAll().concat(ChannelStore.getMoreAll()). + filter(this.filterChannels).sort(this.compareByDisplayName) }); } + filterChannels(channel) { + if (channel.display_name) { + return true; + } + + return false; + } + compareByDisplayName(channelA, channelB) { return channelA.display_name.localeCompare(channelB.display_name); } |