Don't autocomplete for empty string search

This commit is contained in:
ioancole 2020-09-05 10:15:26 +08:00 committed by Sean Yesmunt
parent 7f8d084fa4
commit 72187ca51e

View file

@ -72,6 +72,8 @@ export const doUpdateSearchQuery = (query: string, shouldSkipSuggestions: ?boole
data: { query }, data: { query },
}); });
if (!query) return;
// Don't fetch new suggestions if the user just added a space // Don't fetch new suggestions if the user just added a space
if (!query.endsWith(' ') || !shouldSkipSuggestions) { if (!query.endsWith(' ') || !shouldSkipSuggestions) {
throttledSearchSuggestions(dispatch, query); throttledSearchSuggestions(dispatch, query);