about summary refs log tree commit diff
path: root/app/javascript/mastodon/features/compose
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2021-05-06 02:11:43 +0200
committerGitHub <noreply@github.com>2021-05-06 02:11:43 +0200
commit0a3fa034fc66246dbf9dfb4627a983e0903042d4 (patch)
tree5cb39eb11e17beed0d061a9318112dac319e006b /app/javascript/mastodon/features/compose
parent8d75bd002da5011237b537b522a5b6248e99b9d5 (diff)
Fix "You might be interested in" flashing while searching in web UI (#16162)
Diffstat (limited to 'app/javascript/mastodon/features/compose')
-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 a8b31b677..958a65286 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'>