From 4ab3ad3bef44d245a7c02d05c7cc1788f17b2dd0 Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 24 May 2022 16:10:18 +0200 Subject: [PATCH] Fix crash in glitch-soc search results when Elasticsearch is disabled (#1780) --- .../glitch/features/compose/components/search_results.js | 6 +++--- 1 file changed, 3 insertions(+), 3 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 d92a6bf6bc..e82ee2ca2c 100644 --- a/app/javascript/flavours/glitch/features/compose/components/search_results.js +++ b/app/javascript/flavours/glitch/features/compose/components/search_results.js @@ -48,6 +48,9 @@ class SearchResults extends ImmutablePureComponent { render () { const { intl, results, suggestions, dismissSuggestion, searchTerm } = this.props; + let accounts, statuses, hashtags; + let count = 0; + if (searchTerm === '' && !suggestions.isEmpty()) { return (
@@ -81,9 +84,6 @@ class SearchResults extends ImmutablePureComponent { ); } - let accounts, statuses, hashtags; - let count = 0; - if (results.get('accounts') && results.get('accounts').size > 0) { count += results.get('accounts').size; accounts = (