Fix: search opens when losing focus, prevent unnecessary search API calls (#2867)

Co-Authored-By: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
Florian Hye 2024-02-09 16:49:25 +01:00 committed by shamoon
parent 3955743590
commit 3b76772f81
2 changed files with 52 additions and 31 deletions

View file

@ -120,7 +120,7 @@ export default function QuickLaunch({
});
if (showSearchSuggestions && searchProvider.suggestionUrl) {
if (searchString.trim() !== searchSuggestions[0]) {
if (searchString.trim() !== searchSuggestions[0]?.trim()) {
fetch(
`/api/search/searchSuggestion?query=${encodeURIComponent(searchString)}&providerName=${
searchProvider.name ?? "Custom"