Skip to content

Commit

Permalink
Fix prompt clone error message display
Browse files Browse the repository at this point in the history
  • Loading branch information
cephalization committed Jan 11, 2025
1 parent 26858a7 commit d68f068
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions app/src/pages/prompt/ClonePromptDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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],
});
}
},
});
});
Expand Down

0 comments on commit d68f068

Please sign in to comment.