diff --git a/src/components/Layouts/Layout.tsx b/src/components/Layouts/Layout.tsx index 296c641..03916be 100644 --- a/src/components/Layouts/Layout.tsx +++ b/src/components/Layouts/Layout.tsx @@ -63,13 +63,18 @@ export default function OptionLayout({ return prompts?.find((prompt) => prompt.id === id) } - const handlePromptChange = (value: string) => { + const handlePromptChange = (value?: string) => { + if (!value) { + setSelectedSystemPrompt(undefined) + setSelectedQuickPrompt(undefined) + return + } const prompt = getPromptInfoById(value) if (prompt?.is_system) { setSelectedSystemPrompt(prompt.id) } else { + setSelectedSystemPrompt(undefined) setSelectedQuickPrompt(prompt!.content) - setSelectedSystemPrompt("") } }