stop chat

This commit is contained in:
Nate Kelley 2025-07-13 08:21:53 -06:00
parent fa42592b95
commit bc623cdd30
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
2 changed files with 5 additions and 3 deletions

View File

@ -6,5 +6,5 @@ export const createNewChat = async (props: ChatCreateRequest) => {
}; };
export const stopChat = async ({ chatId }: { chatId: string }) => { export const stopChat = async ({ chatId }: { chatId: string }) => {
return mainApiV2.patch<unknown>(`/chats/${chatId}`, { stop: true }).then((res) => res.data); return mainApiV2.delete<unknown>(`/chats/${chatId}/cancel`).then((res) => res.data);
}; };

View File

@ -135,8 +135,10 @@ export const useChatInputFlow = ({
const onStopChat = useMemoizedFn(() => { const onStopChat = useMemoizedFn(() => {
if (!chatId) return; if (!chatId) return;
onStopChatContext({ chatId, messageId: currentMessageId }); onStopChatContext({ chatId, messageId: currentMessageId });
textAreaRef.current?.focus(); setTimeout(() => {
textAreaRef.current?.select(); textAreaRef.current?.focus();
textAreaRef.current?.select();
}, 100);
}); });
return useMemo( return useMemo(