Remove unnecessary uses of getMoreChannels (#5982)

This commit is contained in:
Joram Wilander
2017-04-04 20:07:51 -04:00
committed by enahum
parent f7a4c75a21
commit 5d6cf3ace5
4 changed files with 1 additions and 41 deletions

View File

@@ -181,7 +181,6 @@ export function doFocusPost(channelId, postId, data) {
post_list: data
});
loadChannelsForCurrentUser();
AsyncClient.getMoreChannels(true);
AsyncClient.getChannelStats(channelId);
loadPostsBefore(postId, 0, Constants.POST_FOCUS_CONTEXT_RADIUS, true);
loadPostsAfter(postId, 0, Constants.POST_FOCUS_CONTEXT_RADIUS, true);

View File

@@ -1562,18 +1562,6 @@ export default class Client {
this.trackEvent('api', 'api_channel_get', {team_id: this.getTeamId(), channel_id: channelId});
}
// SCHEDULED FOR DEPRECATION IN 3.7 - use getMoreChannelsPage instead
getMoreChannels(success, error) {
request.
get(`${this.getChannelsRoute()}/more`).
set(this.defaultHeaders).
type('application/json').
accept('application/json').
end(this.handleResponse.bind(this, 'getMoreChannels', success, error));
this.trackEvent('api', 'api_channels_more', {team_id: this.getTeamId()});
}
getMoreChannelsPage(offset, limit, success, error) {
request.
get(`${this.getChannelsRoute()}/more/${offset}/${limit}`).

View File

@@ -7,7 +7,6 @@ import Constants from 'utils/constants.jsx';
import ChannelStore from 'stores/channel_store.jsx';
import * as Utils from 'utils/utils.jsx';
import {sortChannelsByDisplayName} from 'utils/channel_utils.jsx';
import * as AsyncClient from 'utils/async_client.jsx';
export default class ChannelSelect extends React.Component {
static get propTypes() {
@@ -34,8 +33,6 @@ export default class ChannelSelect extends React.Component {
this.handleChannelChange = this.handleChannelChange.bind(this);
this.filterChannels = this.filterChannels.bind(this);
AsyncClient.getMoreChannels(true);
this.state = {
channels: ChannelStore.getAll().filter(this.filterChannels).sort(sortChannelsByDisplayName)
};
@@ -51,7 +48,7 @@ export default class ChannelSelect extends React.Component {
handleChannelChange() {
this.setState({
channels: ChannelStore.getAll().concat(ChannelStore.getMoreAll()).
channels: ChannelStore.getAll().
filter(this.filterChannels).sort(sortChannelsByDisplayName)
});
}

View File

@@ -208,30 +208,6 @@ export function viewChannel(channelId = ChannelStore.getCurrentId(), prevChannel
);
}
export function getMoreChannels(force) {
if (isCallInProgress('getMoreChannels')) {
return;
}
if (ChannelStore.getMoreAll().loading || force) {
callTracker.getMoreChannels = utils.getTimestamp();
Client.getMoreChannels(
(data) => {
callTracker.getMoreChannels = 0;
AppDispatcher.handleServerAction({
type: ActionTypes.RECEIVED_MORE_CHANNELS,
channels: data
});
},
(err) => {
callTracker.getMoreChannels = 0;
dispatchError(err, 'getMoreChannels');
}
);
}
}
export function getMoreChannelsPage(offset, limit) {
if (isCallInProgress('getMoreChannelsPage')) {
return;