Skip to content

Commit

Permalink
Update index.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
koji committed May 15, 2024
1 parent 10f7b1e commit 476ee2c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion opentrons-ai-client/src/molecules/InputPrompt/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export function InputPrompt(): JSX.Element {
return rowsNum
}

// ToDo (kk:05/15/2024) This will be moved to a better place
const fetchData = async (prompt: string): Promise<void> => {
if (prompt !== '') {
setLoading(true)
Expand Down Expand Up @@ -97,7 +98,7 @@ export function InputPrompt(): JSX.Element {
}, [preparedPrompt, setValue])

React.useEffect(() => {
if (submitted && data && !loading) {
if (submitted && data != null && !loading) {
const { role, reply } = data
const assistantResponse: ChatData = {
role,
Expand Down

0 comments on commit 476ee2c

Please sign in to comment.