diff --git a/src/components/new-safe/OwnerRow/index.tsx b/src/components/new-safe/OwnerRow/index.tsx index 8899c1ca50..f9f4ae34cf 100644 --- a/src/components/new-safe/OwnerRow/index.tsx +++ b/src/components/new-safe/OwnerRow/index.tsx @@ -43,11 +43,12 @@ export const OwnerRow = ({ const validateSafeAddress = useCallback( async (address: string) => { + const owners = getValues('owners') if (owners.filter((owner: NamedAddress) => sameAddress(owner.address, address)).length > 1) { return 'Owner is already added' } }, - [owners], + [getValues], ) const { ens, name, resolving } = useAddressResolver(owner.address) diff --git a/src/components/new-safe/create/steps/Step2/index.tsx b/src/components/new-safe/create/steps/Step2/index.tsx index 8461ed6d06..0ae9e27092 100644 --- a/src/components/new-safe/create/steps/Step2/index.tsx +++ b/src/components/new-safe/create/steps/Step2/index.tsx @@ -43,14 +43,14 @@ const CreateSafeStep2 = ({ useSyncSafeCreationStep(setStep) const formMethods = useForm({ - mode: 'all', + mode: 'onChange', defaultValues: { [CreateSafeStep2Fields.owners]: data.owners, [CreateSafeStep2Fields.threshold]: data.threshold, }, }) - const { handleSubmit, control, watch, formState, getValues, setValue } = formMethods + const { handleSubmit, control, watch, formState, getValues, setValue, trigger } = formMethods const threshold = watch(CreateSafeStep2Fields.threshold) @@ -64,6 +64,7 @@ const CreateSafeStep2 = ({ // Set threshold if it's greater than the number of owners setValue(CreateSafeStep2Fields.threshold, Math.min(threshold, ownerFields.length - 1)) remove(index) + trigger(CreateSafeStep2Fields.owners) } const isDisabled = isWrongChain || !formState.isValid