Skip to content

Commit eb4e81f

Browse files
committed
fix loading status
1 parent ea4dccd commit eb4e81f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/chat-ui/src/chat/chat-section.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ export default function ChatSection(props: ChatSectionProps) {
2020
const [input, setInput] = useState('')
2121
const [requestData, setRequestData] = useState<any>()
2222

23-
const isLoading = handler.status === 'streaming'
23+
// show loading immediately after the user submits the request
24+
// then keep loading util streaming is finished
25+
const isLoading =
26+
handler.status === 'submitted' || handler.status === 'streaming'
2427

2528
const children = props.children ?? (
2629
<>

0 commit comments

Comments
 (0)