* Fix OVERLAY_TIME_DELAY in sidebar_header

* Fix webhook channel selection by adding a filter
Этот коммит содержится в:
enahum
2017-01-23 06:11:37 -03:00
коммит произвёл George Goldberg
родитель 784d85f46d
Коммит b064457c74
2 изменённых файлов: 14 добавлений и 4 удалений

Просмотреть файл

@@ -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);
}