diff --git a/web/src/objects/object-edit-form.tsx b/web/src/objects/object-edit-form.tsx index 901eebe..4829973 100644 --- a/web/src/objects/object-edit-form.tsx +++ b/web/src/objects/object-edit-form.tsx @@ -17,9 +17,11 @@ export function ObjectEditForm() { const locationState = location.state as { fieldsError?: boolean; fieldErrorKey?: string } | null; - const [error, setError] = useState( - locationState?.fieldsError ? t("form.rejected") : null, - ); + const [error, setError] = useState(() => { + if (locationState?.fieldErrorKey) return t("form.fieldRejected", { field: locationState.fieldErrorKey }); + if (locationState?.fieldsError) return t("form.rejected"); + return null; + }); const [fieldErrorKey, setFieldErrorKey] = useState( locationState?.fieldErrorKey ?? null,