diff --git a/src/components/business/Chat/index.vue b/src/components/business/Chat/index.vue index d7f30f4..29fd73a 100644 --- a/src/components/business/Chat/index.vue +++ b/src/components/business/Chat/index.vue @@ -31,6 +31,8 @@ async function handleSubmit() { if (loading.value) return + controller = new AbortController() + const message = prompt.value.trim() if (!message || !message.length) { @@ -53,7 +55,7 @@ async function handleSubmit() { addMessage(data?.text ?? '', { options: { conversationId: data.conversationId, parentMessageId: data.id } }) } catch (error: any) { - if (error.message !== 'cancelled') + if (error.message !== 'canceled') addMessage(`${error.message ?? 'Request failed, please try again later.'}`, { error: true }) } finally { diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 53a37f3..8d5c0ec 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -7,7 +7,3 @@ import { Chat } from '@/components/business' - -