summaryrefslogtreecommitdiff
path: root/packages/aml-backoffice-ui/src/pages/CreateAccount.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/aml-backoffice-ui/src/pages/CreateAccount.tsx')
-rw-r--r--packages/aml-backoffice-ui/src/pages/CreateAccount.tsx5
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/aml-backoffice-ui/src/pages/CreateAccount.tsx b/packages/aml-backoffice-ui/src/pages/CreateAccount.tsx
index abcaaa2a6..87310aa27 100644
--- a/packages/aml-backoffice-ui/src/pages/CreateAccount.tsx
+++ b/packages/aml-backoffice-ui/src/pages/CreateAccount.tsx
@@ -18,6 +18,7 @@ import {
InputLine,
InternationalizationAPI,
LocalNotificationBanner,
+ UIHandlerId,
useLocalNotificationHandler,
useTranslationContext,
} from "@gnu-taler/web-util/browser";
@@ -88,7 +89,8 @@ function createFormValidator(
};
}
-export function undefinedIfEmpty<T extends object>(obj: T): T | undefined {
+export function undefinedIfEmpty<T extends object | undefined>(obj: T): T | undefined {
+ if (obj === undefined) return undefined;
return Object.keys(obj).some(
(k) => (obj as Record<string, T>)[k] !== undefined,
)
@@ -104,6 +106,7 @@ export function CreateAccount(): VNode {
const [notification, withErrorHandler] = useLocalNotificationHandler();
const [form, status] = useFormState<FormType>(
+ [".password", ".repeat"] as Array<UIHandlerId>,
{
password: undefined,
repeat: undefined,