From 1d8b6c7792da63c8d93f1a586819ddb14ee09718 Mon Sep 17 00:00:00 2001 From: Joseph Garrone Date: Sun, 25 Aug 2024 03:19:34 +0200 Subject: [PATCH] Fix logical error in multivalued attributes --- src/login/lib/useUserProfileForm.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/login/lib/useUserProfileForm.tsx b/src/login/lib/useUserProfileForm.tsx index 9155cc49..73859cb8 100644 --- a/src/login/lib/useUserProfileForm.tsx +++ b/src/login/lib/useUserProfileForm.tsx @@ -1394,14 +1394,10 @@ export function getButtonToDisplayForMultivaluedAttributeField(params: { attribu })(); if (maxCount === undefined) { - return false; + return true; } - if (values.length === maxCount) { - return false; - } - - return true; + return values.length !== maxCount; })(); return { hasRemove, hasAdd };