This commit is contained in:
Alex
2023-11-23 00:09:17 +00:00
parent d7a1be2f3c
commit 5bdedacab1
2 changed files with 7 additions and 5 deletions

View File

@@ -255,10 +255,13 @@ const Prompts: React.FC<PromptProps> = ({
}
const newPrompt = await response.json();
if (setPrompts) {
setPrompts([...prompts, newPrompt]);
setPrompts([
...prompts,
{ name: newPromptName, id: newPrompt.id, type: 'private' },
]);
}
onSelectPrompt(newPrompt.name, newPrompt.id, newPrompt.type);
setNewPromptName(newPrompt.name);
onSelectPrompt(newPromptName, newPrompt.id, newPromptContent);
setNewPromptName(newPromptName);
} catch (error) {
console.error(error);
}