From 1d723f82a94cc6dd15b081074caa134ac2dc315f Mon Sep 17 00:00:00 2001 From: Arindam Majumder Date: Thu, 25 Jan 2024 19:51:46 +0530 Subject: [PATCH] fix: Clear Message in New Conversation --- src/app/components/Copilot/Copilot.tsx | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/app/components/Copilot/Copilot.tsx b/src/app/components/Copilot/Copilot.tsx index c568331..6ae9967 100644 --- a/src/app/components/Copilot/Copilot.tsx +++ b/src/app/components/Copilot/Copilot.tsx @@ -46,6 +46,8 @@ export function createNewConversation() { GlobalConversationID = _conversation.id; }) } + + }) } @@ -117,6 +119,22 @@ export function CopilotChat(): React.JSX.Element { setData(event.target.value); }; + // handles the ask button click. + const handleCopilotAskbuttonClick = async (chatInputData, setMessage)=>{ + CopilotStreamController.getInstance().askQGPT({ + query: chatInputData, + setMessage, + }); + setData(""); + } + + // handles the new conversation button click. + const handleNewConversation = async () => { + createNewConversation(); + setMessage("") + setData("") + }; + // for setting the initial copilot chat that takes place on page load. useEffect(() => { const getInitialChat = async () => { @@ -137,7 +155,7 @@ export function CopilotChat(): React.JSX.Element {

Copilot Chat

- +
@@ -148,7 +166,7 @@ export function CopilotChat(): React.JSX.Element {
- +
@@ -158,4 +176,4 @@ export function CopilotChat(): React.JSX.Element {
); -} +} \ No newline at end of file