Skip to content

Commit 0381d41

Browse files
committed
Skip the product search API request if the query is empty.
1 parent 3bbe3d8 commit 0381d41

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

WooCommerce/Classes/ViewRelated/Search/Product/ProductSearchUICommand.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ final class ProductSearchUICommand: SearchUICommand {
101101
onCompletion?(true)
102102
return
103103
}
104+
// Skips the product search API request if the keyword is empty.
105+
guard keyword.isNotEmpty else {
106+
onCompletion?(true)
107+
return
108+
}
104109
lastSearchQueryByFilter[filter] = keyword
105110
}
106111

0 commit comments

Comments
 (0)