From 94639b307694551d74411693cae049ce7a2ace89 Mon Sep 17 00:00:00 2001 From: an-lee Date: Thu, 15 Aug 2024 17:49:11 +0800 Subject: [PATCH] fix chat agent delete --- .../renderer/components/chats/chat-agent-form.tsx | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/enjoy/src/renderer/components/chats/chat-agent-form.tsx b/enjoy/src/renderer/components/chats/chat-agent-form.tsx index 444d891ea..525d05f33 100644 --- a/enjoy/src/renderer/components/chats/chat-agent-form.tsx +++ b/enjoy/src/renderer/components/chats/chat-agent-form.tsx @@ -28,7 +28,6 @@ import { SelectValue, Slider, Textarea, - toast, } from "@renderer/components/ui"; import { t } from "i18next"; import { LANGUAGES } from "@/constants"; @@ -50,7 +49,7 @@ export const ChatAgentForm = (props: { onDestroy: () => void; }) => { const { agent, onSave, onDestroy } = props; - const { learningLanguage, webApi, EnjoyApp } = useContext( + const { learningLanguage, webApi } = useContext( AppSettingsProviderContext ); const { openai } = useContext(AISettingsProviderContext); @@ -127,15 +126,6 @@ export const ChatAgentForm = (props: { setGptProviders({ ...providers }); }; - const destroyChatAgent = async () => { - EnjoyApp.chatAgents - .destroy(agent.id) - .then(() => onDestroy()) - .catch((e) => { - toast.error(t(e.message)); - }); - }; - const refreshTtsProviders = async () => { let providers = TTS_PROVIDERS; @@ -455,7 +445,7 @@ export const ChatAgentForm = (props: { {t("cancel")} {t("delete")}