From d68f068c3e008b153117ef8043c490c47c28f62b Mon Sep 17 00:00:00 2001 From: Tony Powell Date: Sat, 11 Jan 2025 11:57:42 -0500 Subject: [PATCH] Fix prompt clone error message display --- app/src/pages/prompt/ClonePromptDialog.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/src/pages/prompt/ClonePromptDialog.tsx b/app/src/pages/prompt/ClonePromptDialog.tsx index 2544df1e99..0188305ac5 100644 --- a/app/src/pages/prompt/ClonePromptDialog.tsx +++ b/app/src/pages/prompt/ClonePromptDialog.tsx @@ -80,9 +80,15 @@ export const ClonePromptDialog = ({ }, onError: (error) => { const message = getErrorMessagesFromRelayMutationError(error); - setError("root", { - message: message?.[0] ?? "An error occurred", - }); + if (message?.[0]?.includes("already exists")) { + setError("name", { + message: message?.[0], + }); + } else { + setError("root", { + message: message?.[0], + }); + } }, }); });