Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-hodgson committed Sep 24, 2024
1 parent c209b06 commit f83c791
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,12 @@ export const SynapseChat: React.FunctionComponent<SynapseChatProps> = ({
const [initialMessageProcessed, setInitialMessageProcessed] = useState(false)
const { mutate: sendChatMessageToAgent } = useSendChatMessageToAgent(
{
onSuccess: async data => {
onSuccess: data => {
// whenever the response is returned, set the last interaction response text
setCurrentResponse(data.responseText)
setCurrentlyProcessingJobId(undefined)
},
onError: err => {
setCurrentResponseError(err.reason)
setCurrentlyProcessingJobId(undefined)
},
},
(status: AsynchronousJobStatus<AgentChatRequest, AgentChatResponse>) => {
Expand Down Expand Up @@ -139,6 +137,7 @@ export const SynapseChat: React.FunctionComponent<SynapseChatProps> = ({
setCurrentResponse('')
setCurrentResponseError('')
setPendingInteraction(undefined)
setCurrentlyProcessingJobId(undefined)
}
}, [currentResponse, currentResponseError, pendingInteraction])

Expand Down

0 comments on commit f83c791

Please sign in to comment.