Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Clear Message in New Conversation #74

Merged
merged 2 commits into from Jan 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/app/components/Copilot/Copilot.tsx
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>
);
}
}