Fix: also trim searchSuggestions[0] for comparison with searchString

This fixes an issue where the searchSuggestions[0] would end with a space and therefor not match the searchString which is trimmed.
This commit is contained in:
Flo2410 2024-02-08 18:55:41 +00:00
parent 74a52d9288
commit eef38d96a9
No known key found for this signature in database
GPG Key ID: 8ECB00AC5216DC7F

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"