Skip to content
Snippets Groups Projects
Unverified Commit 0a3fa034 authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub
Browse files

Fix "You might be interested in" flashing while searching in web UI (#16162)

parent 8d75bd00
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,7 @@ export function submitSearch() {
const value = getState().getIn(['search', 'value']);
if (value.length === 0) {
dispatch(fetchSearchSuccess({ accounts: [], statuses: [], hashtags: [] }, ''));
return;
}
......
......@@ -33,6 +33,12 @@ class SearchResults extends ImmutablePureComponent {
}
}
componentDidUpdate () {
if (this.props.searchTerm === '') {
this.props.fetchSuggestions();
}
}
handleLoadMoreAccounts = () => this.props.expandSearch('accounts');
handleLoadMoreStatuses = () => this.props.expandSearch('statuses');
......@@ -42,7 +48,7 @@ class SearchResults extends ImmutablePureComponent {
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'>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment