Skip to content

Commit 7e807aa

Browse files
authored
Don't prevent sending message in AI chat when loading followup suggestions (#3426)
1 parent 973c74e commit 7e807aa

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/gitbook/src/components/AI/useAIChat.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,13 @@ export function useAIChatController(): AIChatController {
137137

138138
switch (event.type) {
139139
case 'response_finish': {
140-
setState((state) => ({ ...state, responseId: event.responseId }));
140+
setState((state) => ({
141+
...state,
142+
responseId: event.responseId,
143+
// Mark as not loading when the response is finished
144+
// Even if the stream might continue as we receive 'response_followup_suggestion'
145+
loading: false,
146+
}));
141147
break;
142148
}
143149
case 'response_followup_suggestion': {

0 commit comments

Comments
 (0)