Remove unnecessary uses of getMoreChannels (#5982)
Этот коммит содержится в:
коммит произвёл
enahum
родитель
f7a4c75a21
Коммит
5d6cf3ace5
@@ -181,7 +181,6 @@ export function doFocusPost(channelId, postId, data) {
|
|||||||
post_list: data
|
post_list: data
|
||||||
});
|
});
|
||||||
loadChannelsForCurrentUser();
|
loadChannelsForCurrentUser();
|
||||||
AsyncClient.getMoreChannels(true);
|
|
||||||
AsyncClient.getChannelStats(channelId);
|
AsyncClient.getChannelStats(channelId);
|
||||||
loadPostsBefore(postId, 0, Constants.POST_FOCUS_CONTEXT_RADIUS, true);
|
loadPostsBefore(postId, 0, Constants.POST_FOCUS_CONTEXT_RADIUS, true);
|
||||||
loadPostsAfter(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});
|
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) {
|
getMoreChannelsPage(offset, limit, success, error) {
|
||||||
request.
|
request.
|
||||||
get(`${this.getChannelsRoute()}/more/${offset}/${limit}`).
|
get(`${this.getChannelsRoute()}/more/${offset}/${limit}`).
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import Constants from 'utils/constants.jsx';
|
|||||||
import ChannelStore from 'stores/channel_store.jsx';
|
import ChannelStore from 'stores/channel_store.jsx';
|
||||||
import * as Utils from 'utils/utils.jsx';
|
import * as Utils from 'utils/utils.jsx';
|
||||||
import {sortChannelsByDisplayName} from 'utils/channel_utils.jsx';
|
import {sortChannelsByDisplayName} from 'utils/channel_utils.jsx';
|
||||||
import * as AsyncClient from 'utils/async_client.jsx';
|
|
||||||
|
|
||||||
export default class ChannelSelect extends React.Component {
|
export default class ChannelSelect extends React.Component {
|
||||||
static get propTypes() {
|
static get propTypes() {
|
||||||
@@ -34,8 +33,6 @@ export default class ChannelSelect extends React.Component {
|
|||||||
this.handleChannelChange = this.handleChannelChange.bind(this);
|
this.handleChannelChange = this.handleChannelChange.bind(this);
|
||||||
this.filterChannels = this.filterChannels.bind(this);
|
this.filterChannels = this.filterChannels.bind(this);
|
||||||
|
|
||||||
AsyncClient.getMoreChannels(true);
|
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
channels: ChannelStore.getAll().filter(this.filterChannels).sort(sortChannelsByDisplayName)
|
channels: ChannelStore.getAll().filter(this.filterChannels).sort(sortChannelsByDisplayName)
|
||||||
};
|
};
|
||||||
@@ -51,7 +48,7 @@ export default class ChannelSelect extends React.Component {
|
|||||||
|
|
||||||
handleChannelChange() {
|
handleChannelChange() {
|
||||||
this.setState({
|
this.setState({
|
||||||
channels: ChannelStore.getAll().concat(ChannelStore.getMoreAll()).
|
channels: ChannelStore.getAll().
|
||||||
filter(this.filterChannels).sort(sortChannelsByDisplayName)
|
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) {
|
export function getMoreChannelsPage(offset, limit) {
|
||||||
if (isCallInProgress('getMoreChannelsPage')) {
|
if (isCallInProgress('getMoreChannelsPage')) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user