diff --git a/apps/web/src/api/buster_rest/chats/requestsV2.ts b/apps/web/src/api/buster_rest/chats/requestsV2.ts index 33546f28d..acb8811ae 100644 --- a/apps/web/src/api/buster_rest/chats/requestsV2.ts +++ b/apps/web/src/api/buster_rest/chats/requestsV2.ts @@ -6,5 +6,5 @@ export const createNewChat = async (props: ChatCreateRequest) => { }; export const stopChat = async ({ chatId }: { chatId: string }) => { - return mainApiV2.patch(`/chats/${chatId}`, { stop: true }).then((res) => res.data); + return mainApiV2.delete(`/chats/${chatId}/cancel`).then((res) => res.data); }; diff --git a/apps/web/src/layouts/ChatLayout/ChatContainer/ChatContent/ChatInput/useChatInputFlow.ts b/apps/web/src/layouts/ChatLayout/ChatContainer/ChatContent/ChatInput/useChatInputFlow.ts index 3b702bf48..864855182 100644 --- a/apps/web/src/layouts/ChatLayout/ChatContainer/ChatContent/ChatInput/useChatInputFlow.ts +++ b/apps/web/src/layouts/ChatLayout/ChatContainer/ChatContent/ChatInput/useChatInputFlow.ts @@ -135,8 +135,10 @@ export const useChatInputFlow = ({ const onStopChat = useMemoizedFn(() => { if (!chatId) return; onStopChatContext({ chatId, messageId: currentMessageId }); - textAreaRef.current?.focus(); - textAreaRef.current?.select(); + setTimeout(() => { + textAreaRef.current?.focus(); + textAreaRef.current?.select(); + }, 100); }); return useMemo(