summaryrefslogtreecommitdiffstats
path: root/webapp/components/channel_select.jsx
diff options
context:
space:
mode:
authorenahum <nahumhbl@gmail.com>2017-01-23 06:11:37 -0300
committerGeorge Goldberg <george@gberg.me>2017-01-23 09:11:37 +0000
commitb064457c745ae6bf27e5e6933a0a7406f3f4921d (patch)
tree4ffbdf18bbfee9c88c23aecdda8cc6be2a5f20a8 /webapp/components/channel_select.jsx
parent784d85f46d1dee7ab74f7e12243815712a1d6099 (diff)
downloadchat-b064457c745ae6bf27e5e6933a0a7406f3f4921d.tar.gz
chat-b064457c745ae6bf27e5e6933a0a7406f3f4921d.tar.bz2
chat-b064457c745ae6bf27e5e6933a0a7406f3f4921d.zip
Random fixes (#5145)
* Fix OVERLAY_TIME_DELAY in sidebar_header * Fix webhook channel selection by adding a filter
Diffstat (limited to 'webapp/components/channel_select.jsx')
-rw-r--r--webapp/components/channel_select.jsx14
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);
}