mirror of https://github.com/buster-so/buster.git
stop chat
This commit is contained in:
parent
fa42592b95
commit
bc623cdd30
|
@ -6,5 +6,5 @@ export const createNewChat = async (props: ChatCreateRequest) => {
|
|||
};
|
||||
|
||||
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);
|
||||
};
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue