about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/compose/components
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2021-05-06 02:11:43 +0200
committerClaire <claire.github-309c@sitedethib.com>2021-05-07 22:00:11 +0200
commit5fa4138bd891a490de238f34755ada53fff987d7 (patch)
tree750f186162ba536525ebf63b7dc2fa4680a14793 /app/javascript/flavours/glitch/features/compose/components
parentb571bc3278e39fda2caaa6663cdfd0015eb716b7 (diff)
[Glitch] Fix "You might be interested in" flashing while searching in web UI
Port 0a3fa034fc66246dbf9dfb4627a983e0903042d4 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/features/compose/components')
-rw-r--r--app/javascript/flavours/glitch/features/compose/components/search_results.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/features/compose/components/search_results.js b/app/javascript/flavours/glitch/features/compose/components/search_results.js
index c7e225507..a0f86a06a 100644
--- a/app/javascript/flavours/glitch/features/compose/components/search_results.js
+++ b/app/javascript/flavours/glitch/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='drawer--results'>
           <div className='trends'>