summaryrefslogtreecommitdiffstats
path: root/app/javascript/mastodon/features/compose/components/search_results.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/javascript/mastodon/features/compose/components/search_results.js')
-rw-r--r--app/javascript/mastodon/features/compose/components/search_results.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/javascript/mastodon/features/compose/components/search_results.js b/app/javascript/mastodon/features/compose/components/search_results.js
index a8b31b677b2..958a65286b6 100644
--- a/app/javascript/mastodon/features/compose/components/search_results.js
+++ b/app/javascript/mastodon/features/compose/components/search_results.js
@@ -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'>