mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Only searching suggestions when searchStr has a value.
This commit is contained in:
parent
7669cfe361
commit
a5fb634766
1 changed files with 5 additions and 2 deletions
|
|
@ -109,10 +109,13 @@ export function useSuggestions(searchStr, tagNames, filter) {
|
|||
const {data: zimData, sendRequest: sendZimRequest, loading: zimLoading} = useLatestRequest(500);
|
||||
|
||||
React.useEffect(() => {
|
||||
if ((searchStr && searchStr.length > 0) || (tagNames && tagNames.length > 0)) {
|
||||
if (searchStr || (tagNames && tagNames.length > 0)) {
|
||||
const mimetypes = filterToMimetypes(filter);
|
||||
setSuggestions(defaultSuggestions);
|
||||
sendGeneralReqeust(async () => await searchSuggestions(searchStr));
|
||||
if (searchStr && searchStr.length > 0) {
|
||||
// We can't search Channels/Domains without some string to filter by.
|
||||
sendGeneralReqeust(async () => await searchSuggestions(searchStr));
|
||||
}
|
||||
sendFilesRequest(async () => await searchEstimateFiles(searchStr, tagNames, mimetypes, months, dateRange));
|
||||
sendZimRequest(async () => await searchEstimateZims(searchStr, tagNames));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue