Skip to content

Commit

Permalink
Merge pull request #74 from Arindam200/patch-2
Browse files Browse the repository at this point in the history
fix: Clear Message in New Conversation
  • Loading branch information
jwafu authored Jan 26, 2024
2 parents cb5c75a + 8547d0f commit a46c7c0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/app/components/Copilot/Copilot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export function createNewConversation() {
GlobalConversationID = _conversation.id;
})
}


})
}

Expand Down Expand Up @@ -126,6 +128,13 @@ export function CopilotChat(): React.JSX.Element {
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 () => {
Expand All @@ -146,7 +155,7 @@ export function CopilotChat(): React.JSX.Element {
<div className="header">
<div>
<h1>Copilot Chat</h1>
<button className="button" onClick={createNewConversation}>Create Fresh Conversation</button>
<button className="button" onClick={handleNewConversation}>Create Fresh Conversation</button>
</div>
<div className="footer">
<button>back</button>
Expand All @@ -167,4 +176,4 @@ export function CopilotChat(): React.JSX.Element {
</div>
</div>
);
}
}

0 comments on commit a46c7c0

Please sign in to comment.