From 7ba3f39d10046a7f59bf3fb7c7fd65bd9efef306 Mon Sep 17 00:00:00 2001 From: Ashley Stanton-Nurse Date: Wed, 17 Apr 2024 10:36:28 -0700 Subject: [PATCH] fix copilot insertion so it doesn't wipe existing query text --- src/Explorer/QueryCopilot/QueryCopilotPromptbar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Explorer/QueryCopilot/QueryCopilotPromptbar.tsx b/src/Explorer/QueryCopilot/QueryCopilotPromptbar.tsx index 6aaebc926..9f65e9e85 100644 --- a/src/Explorer/QueryCopilot/QueryCopilotPromptbar.tsx +++ b/src/Explorer/QueryCopilot/QueryCopilotPromptbar.tsx @@ -218,7 +218,7 @@ export const QueryCopilotPromptbar: React.FC = ({ generateSQLQueryResponse.explanation ? generateSQLQueryResponse.explanation : "N/A" }\r\n`; const currentGeneratedQuery = queryExplanation + generateSQLQueryResponse.sql; - const lastQuery = generatedQuery && query ? `${query}\r\n` : ""; + const lastQuery = query ? `${query}\r\n` : ""; setQuery(`${lastQuery}${currentGeneratedQuery}`); setGeneratedQuery(generateSQLQueryResponse.sql); setGeneratedQueryComments(generateSQLQueryResponse.explanation);