Fix crash in glitch-soc search results when Elasticsearch is disabled (#1780)

signup-info-prompt
Claire 2022-05-24 16:10:18 +02:00 committed by GitHub
parent 1beb8db4e2
commit 4ab3ad3bef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -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 (
<div className='drawer--results'>
@ -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 = (