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 }) => {
|
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(() => {
|
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(
|
||||||
|
|
Loading…
Reference in New Issue