mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Remove unnecessary uses of getMoreChannels (#5982)
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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}`).
|
||||
|
||||
@@ -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)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user