From f57726dc95a9c3853a0e771b0573b20d2af1c3c8 Mon Sep 17 00:00:00 2001 From: Leo Giovanetti Date: Thu, 11 Aug 2022 20:48:58 -0300 Subject: [PATCH] Hotfix: Signup fix error not shown (#3815) * Fix error not shown * Simplifying * Removing dead code --- packages/ui/v2/form/fields.tsx | 40 ++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/packages/ui/v2/form/fields.tsx b/packages/ui/v2/form/fields.tsx index 62e48adb65..7746a2ae82 100644 --- a/packages/ui/v2/form/fields.tsx +++ b/packages/ui/v2/form/fields.tsx @@ -55,25 +55,17 @@ function HintsOrErrors(props: { if (!hintErrors && fieldErrors && !fieldErrors.message) { // no hints passed, field errors exist and they are custom ones return ( - <> - {fieldErrors?.message && ( -
- - {fieldErrors.message} -
- )} -
-
    - {Object.keys(fieldErrors).map((key: string) => { - return ( -
  • - {t(`${fieldName}_hint_${key}`)} -
  • - ); - })} -
-
- +
+
    + {Object.keys(fieldErrors).map((key: string) => { + return ( +
  • + {t(`${fieldName}_hint_${key}`)} +
  • + ); + })} +
+
); } @@ -107,6 +99,16 @@ function HintsOrErrors(props: { ); } + // errors exist, not custom ones, just show them as is + if (fieldErrors) { + return ( +
+ + {fieldErrors.message} +
+ ); + } + if (!hintErrors) return null; // hints passed, no errors exist, proceed to just show hints