remove converted channel (into private) from "MoreChannels" screen of joinable channels (#1740)

This commit is contained in:
Saturnino Abril 2018-06-08 03:52:40 +08:00 committed by Elias Nahum
parent 02f0e7348d
commit 90adb0524b
3 changed files with 26 additions and 11 deletions

View file

@ -100,15 +100,30 @@ export default class MoreChannels extends PureComponent {
setNavigatorStyles(this.props.navigator, nextProps.theme);
}
const {page, searching, term} = this.state;
let channels;
if (nextProps.channels !== this.props.channels) {
channels = nextProps.channels.slice(0, (page + 1) * General.CHANNELS_CHUNK_SIZE);
if (term) {
channels = this.filterChannels(nextProps.channels, term);
}
}
const {requestStatus} = this.props;
if (this.state.searching &&
nextProps.requestStatus.status === RequestStatus.SUCCESS) {
const channels = this.filterChannels(nextProps.channels, this.state.term);
this.setState({channels, showNoResults: true});
} else if (requestStatus.status === RequestStatus.STARTED &&
nextProps.requestStatus.status === RequestStatus.SUCCESS) {
const {page} = this.state;
const channels = nextProps.channels.slice(0, (page + 1) * General.CHANNELS_CHUNK_SIZE);
if (
searching &&
nextProps.requestStatus.status === RequestStatus.SUCCESS
) {
channels = this.filterChannels(nextProps.channels, term);
} else if (
requestStatus.status === RequestStatus.STARTED &&
nextProps.requestStatus.status === RequestStatus.SUCCESS
) {
channels = nextProps.channels.slice(0, (page + 1) * General.CHANNELS_CHUNK_SIZE);
}
if (channels) {
this.setState({channels, showNoResults: true});
}

4
package-lock.json generated
View file

@ -9878,8 +9878,8 @@
}
},
"mattermost-redux": {
"version": "github:mattermost/mattermost-redux#8870c690f2e29d301a65fc2f0cba77070f355fa3",
"from": "github:mattermost/mattermost-redux#8870c690f2e29d301a65fc2f0cba77070f355fa3",
"version": "github:mattermost/mattermost-redux#2ef52763c82ca1ad338e5a4dc3dc557a0ecfd528",
"from": "github:mattermost/mattermost-redux#2ef52763c82ca1ad338e5a4dc3dc557a0ecfd528",
"requires": {
"deep-equal": "1.0.1",
"eslint-plugin-header": "1.2.0",

View file

@ -15,7 +15,7 @@
"intl": "1.2.5",
"jail-monkey": "1.0.0",
"jsc-android": "216113.0.3",
"mattermost-redux": "github:mattermost/mattermost-redux#8870c690f2e29d301a65fc2f0cba77070f355fa3",
"mattermost-redux": "github:mattermost/mattermost-redux#2ef52763c82ca1ad338e5a4dc3dc557a0ecfd528",
"mime-db": "1.33.0",
"prop-types": "15.6.1",
"react": "16.3.2",