Skip to content

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

Dont send prompt if responding

Joshen Lim81c3c315fc12
diff --git a/packages/ui/src/components/Command/GenerateSQL/GenerateSQL.tsx b/packages/ui/src/components/Command/GenerateSQL/GenerateSQL.tsx
index 66e9b9dd4e9..d86eeae5de9 100644
--- a/packages/ui/src/components/Command/GenerateSQL/GenerateSQL.tsx
+++ b/packages/ui/src/components/Command/GenerateSQL/GenerateSQL.tsx
@@ -204,7 +204,15 @@ const GenerateSQL = () => {
handleSubmit(query)
}
}}
- onKeyDown={(e) => e.keyCode === 13 && handleSubmit(query)}
+ onKeyDown={(e) => {
+ switch (e.key) {
+ case 'Enter':
+ if (!search || isLoading || isResponding) return
+ return handleSubmit(query)
+ default:
+ return
+ }
+ }}
forceMount
key={query.replace(/\s+/g, '_')}
>