diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-04-04 20:07:51 -0400 |
---|---|---|
committer | enahum <nahumhbl@gmail.com> | 2017-04-04 21:07:51 -0300 |
commit | 5d6cf3ace5871aaa6b91abbc92bb90871be672bb (patch) | |
tree | d9d1e1e13e1cec01d11942ea48c4bdd3360e0692 /webapp | |
parent | f7a4c75a214fb239989618e9583d78f98256e66c (diff) | |
download | chat-5d6cf3ace5871aaa6b91abbc92bb90871be672bb.tar.gz chat-5d6cf3ace5871aaa6b91abbc92bb90871be672bb.tar.bz2 chat-5d6cf3ace5871aaa6b91abbc92bb90871be672bb.zip |
Remove unnecessary uses of getMoreChannels (#5982)
Diffstat (limited to 'webapp')
-rw-r--r-- | webapp/actions/global_actions.jsx | 1 | ||||
-rw-r--r-- | webapp/client/client.jsx | 12 | ||||
-rw-r--r-- | webapp/components/channel_select.jsx | 5 | ||||
-rw-r--r-- | webapp/utils/async_client.jsx | 24 |
4 files changed, 1 insertions, 41 deletions
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; |