Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix(cmdk): doc search try again display logic

Greg Richardson84651ecbf9fc
diff --git a/packages/ui/src/components/Command/DocsSearch.tsx b/packages/ui/src/components/Command/DocsSearch.tsx
index 2779e7516c2..c3f61926632 100644
--- a/packages/ui/src/components/Command/DocsSearch.tsx
+++ b/packages/ui/src/components/Command/DocsSearch.tsx
@@ -124,7 +124,8 @@ const DocsSearch = ({ query, setQuery }: DocsSearchProps) => {
return (
<>
- {results?.length > 0 &&
+ {results &&
+ results.length > 0 &&
results.map((page, i) => {
const pageSections = page.sections.filter((section) => !!section.heading)
return (
@@ -203,8 +204,8 @@ const DocsSearch = ({ query, setQuery }: DocsSearchProps) => {
</CommandGroup>
)
})}
- {results?.length === 0 && (
- <CommandGroup heading="" forceMount>
+ {!results && !hasSearchError && (
+ <CommandGroup forceMount>
{questions.map((question) => {
const key = question.replace(/\s+/g, '_')
return (