Do not search if normalized query is empty

Fixes #5137
This commit is contained in:
Quentin Hibon 2021-04-08 12:32:12 +02:00
parent 86cb7c97be
commit 8abd73fa4f

View file

@ -247,6 +247,9 @@ function updateSearchTerm(query: string): UpdateSearchTermActionType {
async function queryMessages(query: string, searchConversationId?: string) {
try {
const normalized = cleanSearchTerm(query);
if (normalized.length === 0) {
return [];
}
if (searchConversationId) {
return searchMessagesInConversation(normalized, searchConversationId);