const value = getState().getIn(['search', 'value']);
if (value.length === 0) {
+ dispatch(fetchSearchSuccess({ accounts: [], statuses: [], hashtags: [] }, ''));
return;
}
}
}
+ componentDidUpdate () {
+ if (this.props.searchTerm === '') {
+ this.props.fetchSuggestions();
+ }
+ }
+
handleLoadMoreAccounts = () => this.props.expandSearch('accounts');
handleLoadMoreStatuses = () => this.props.expandSearch('statuses');
render () {
const { intl, results, suggestions, dismissSuggestion, searchTerm } = this.props;
- if (results.isEmpty() && !suggestions.isEmpty()) {
+ if (searchTerm === '' && !suggestions.isEmpty()) {
return (
<div className='search-results'>
<div className='trends'>