diff options
author | Carlos Tadeu Panato Junior <ctadeu@gmail.com> | 2017-01-27 11:39:13 +0100 |
---|---|---|
committer | George Goldberg <george@gberg.me> | 2017-01-27 10:39:13 +0000 |
commit | d72547433af3ec5829ce0de4f4e1cfd440be7142 (patch) | |
tree | 6bd7664e9058468842c7b7bb7c7a76abf1b7c5e3 /webapp/components/search_bar.jsx | |
parent | 49c677f6b46409289210abc0e0bda63735be3e9f (diff) | |
download | chat-d72547433af3ec5829ce0de4f4e1cfd440be7142.tar.gz chat-d72547433af3ec5829ce0de4f4e1cfd440be7142.tar.bz2 chat-d72547433af3ec5829ce0de4f4e1cfd440be7142.zip |
Move remaining client functions in components to actions (#5171)
Diffstat (limited to 'webapp/components/search_bar.jsx')
-rw-r--r-- | webapp/components/search_bar.jsx | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/webapp/components/search_bar.jsx b/webapp/components/search_bar.jsx index 77f62a708..c5fcd4697 100644 --- a/webapp/components/search_bar.jsx +++ b/webapp/components/search_bar.jsx @@ -2,8 +2,6 @@ // See License.txt for license information. import $ from 'jquery'; -import Client from 'client/web_client.jsx'; -import * as AsyncClient from 'utils/async_client.jsx'; import * as GlobalActions from 'actions/global_actions.jsx'; import SearchStore from 'stores/search_store.jsx'; import UserStore from 'stores/user_store.jsx'; @@ -14,7 +12,7 @@ import SearchSuggestionList from './suggestion/search_suggestion_list.jsx'; import SearchUserProvider from './suggestion/search_user_provider.jsx'; import * as Utils from 'utils/utils.jsx'; import Constants from 'utils/constants.jsx'; -import {loadProfilesForPosts, getFlaggedPosts} from 'actions/post_actions.jsx'; +import {getFlaggedPosts, performSearch} from 'actions/post_actions.jsx'; import {FormattedMessage, FormattedHTMLMessage} from 'react-intl'; @@ -118,26 +116,18 @@ export default class SearchBar extends React.Component { if (terms.length) { this.setState({isSearching: true}); - Client.search( + performSearch( terms, isMentionSearch, - (data) => { + () => { this.setState({isSearching: false}); + if (Utils.isMobile() && this.search) { this.search.value = ''; } - - AppDispatcher.handleServerAction({ - type: ActionTypes.RECEIVED_SEARCH, - results: data, - is_mention_search: isMentionSearch - }); - - loadProfilesForPosts(data.posts); }, - (err) => { + () => { this.setState({isSearching: false}); - AsyncClient.dispatchError(err, 'search'); } ); } |