From e526ad3bda2ffc54728afc8a59abd77a60e87a45 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 2 Oct 2025 22:02:42 +0100 Subject: [PATCH] fix: prevent no results flickering --- apps/web/src/components/CommandPallette.tsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/apps/web/src/components/CommandPallette.tsx b/apps/web/src/components/CommandPallette.tsx index c794ee42..28cbd943 100644 --- a/apps/web/src/components/CommandPallette.tsx +++ b/apps/web/src/components/CommandPallette.tsx @@ -74,7 +74,7 @@ export default function CommandPallette({ ? [] : ((searchResults ?? []) as SearchResult[]); - const hasSearched = Boolean(debouncedQuery.trim().length > 0 && isFetched); + const hasSearched = Boolean(debouncedQuery.trim().length > 0); return ( )} - {hasSearched && !isLoading && results.length === 0 && ( -
- {t`No results found for "${query}".`} -
- )} + {hasSearched && + !isLoading && + searchResults !== undefined && + results.length === 0 && ( +
+ {t`No results found for "${debouncedQuery}".`} +
+ )}