From 5d6cf3ace5871aaa6b91abbc92bb90871be672bb Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Tue, 4 Apr 2017 20:07:51 -0400 Subject: Remove unnecessary uses of getMoreChannels (#5982) --- webapp/actions/global_actions.jsx | 1 - webapp/client/client.jsx | 12 ------------ webapp/components/channel_select.jsx | 5 +---- webapp/utils/async_client.jsx | 24 ------------------------ 4 files changed, 1 insertion(+), 41 deletions(-) (limited to 'webapp') diff --git a/webapp/actions/global_actions.jsx b/webapp/actions/global_actions.jsx index 2279a0b96..f067a80be 100644 --- a/webapp/actions/global_actions.jsx +++ b/webapp/actions/global_actions.jsx @@ -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); diff --git a/webapp/client/client.jsx b/webapp/client/client.jsx index c1a9d2f85..6e04b1f7a 100644 --- a/webapp/client/client.jsx +++ b/webapp/client/client.jsx @@ -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}`). diff --git a/webapp/components/channel_select.jsx b/webapp/components/channel_select.jsx index ad0abd501..49c1edfef 100644 --- a/webapp/components/channel_select.jsx +++ b/webapp/components/channel_select.jsx @@ -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) }); } diff --git a/webapp/utils/async_client.jsx b/webapp/utils/async_client.jsx index faaf3aee6..1879fed4a 100644 --- a/webapp/utils/async_client.jsx +++ b/webapp/utils/async_client.jsx @@ -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; -- cgit v1.2.3-1-g7c22