From 392d5d7da1efe4568c345f7d7feed83e0e7efdd9 Mon Sep 17 00:00:00 2001 From: daledah Date: Fri, 4 Oct 2024 00:41:48 +0700 Subject: [PATCH] fix: remove eslint disable line --- .../ValidateCodeForm/BaseValidateCodeForm.tsx | 3 +-- src/pages/settings/Wallet/VerifyAccountPage.tsx | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/ValidateCodeActionModal/ValidateCodeForm/BaseValidateCodeForm.tsx b/src/components/ValidateCodeActionModal/ValidateCodeForm/BaseValidateCodeForm.tsx index 104b865bac4..f71b957387a 100644 --- a/src/components/ValidateCodeActionModal/ValidateCodeForm/BaseValidateCodeForm.tsx +++ b/src/components/ValidateCodeActionModal/ValidateCodeForm/BaseValidateCodeForm.tsx @@ -127,8 +127,7 @@ function BaseValidateCodeForm({ useEffect(() => { clearError(); - // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps - }, []); + }, [clearError]); useEffect(() => { if (!hasMagicCodeBeenSent) { diff --git a/src/pages/settings/Wallet/VerifyAccountPage.tsx b/src/pages/settings/Wallet/VerifyAccountPage.tsx index 1fb39304ec4..e375f03ba58 100644 --- a/src/pages/settings/Wallet/VerifyAccountPage.tsx +++ b/src/pages/settings/Wallet/VerifyAccountPage.tsx @@ -49,6 +49,10 @@ function VerifyAccountPage({route}: VerifyAccountPageProps) { [loginList, contactMethod], ); + const clearError = useCallback(() => { + User.clearContactMethodErrors(contactMethod, 'validateLogin'); + }, [contactMethod]); + useEffect(() => { if (!isUserValidated) { return; @@ -73,7 +77,7 @@ function VerifyAccountPage({route}: VerifyAccountPageProps) { validateCodeAction={validateCodeAction} validateError={validateLoginError} handleSubmitForm={handleSubmitForm} - clearError={() => User.clearContactMethodErrors(contactMethod, 'validateLogin')} + clearError={clearError} buttonStyles={[styles.justifyContentEnd, styles.flex1, safePaddingBottomStyle]} />