From 1439353262e46d08e354d251cb8c0e46324867ae Mon Sep 17 00:00:00 2001 From: KY Lau Date: Wed, 9 Jun 2021 18:49:43 +0800 Subject: [PATCH] Revert "Attempt fix issue" This reverts commit e3d916fe6142a30ad95c8199fa9f690c9e0319be. --- .../molecules/FormFields/Credential/index.tsx | 18 ++++++------------ .../AssetActions/Edit/EditAdvanceSettings.tsx | 2 +- .../AssetActions/Edit/FormAdvanceSettings.tsx | 2 +- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/components/molecules/FormFields/Credential/index.tsx b/src/components/molecules/FormFields/Credential/index.tsx index c8cbb791e..8906e1b19 100644 --- a/src/components/molecules/FormFields/Credential/index.tsx +++ b/src/components/molecules/FormFields/Credential/index.tsx @@ -27,24 +27,18 @@ export default function Credential(props: InputProps) { helpers.setValue(newInput) } - function isCredentialValid(): boolean { + function handleAddValue(e: FormEvent) { + e.preventDefault() if (!isAddress(value)) { toast.error('Wallet address is invalid') - return false + return } if (arrayInput.includes(value)) { toast.error('Wallet address already added into list') - return false - } - return true - } - - function handleAddValue(e: FormEvent) { - e.preventDefault() - if (isCredentialValid()) { - setArrayInput((arrayInput) => [...arrayInput, value]) - setValue('') + return } + setArrayInput((arrayInput) => [...arrayInput, value]) + setValue('') } return ( diff --git a/src/components/organisms/AssetActions/Edit/EditAdvanceSettings.tsx b/src/components/organisms/AssetActions/Edit/EditAdvanceSettings.tsx index a3e4ad52b..00fd691a0 100644 --- a/src/components/organisms/AssetActions/Edit/EditAdvanceSettings.tsx +++ b/src/components/organisms/AssetActions/Edit/EditAdvanceSettings.tsx @@ -123,7 +123,7 @@ export default function EditAdvanceSettings({ {({ isSubmitting, values, initialValues }) => isSubmitting || hasFeedback ? (