From 6bbde98895cc419337189edc43acf80d317c4d94 Mon Sep 17 00:00:00 2001 From: Danh Date: Tue, 24 Oct 2023 16:57:38 +0700 Subject: [PATCH] refactor --- src/pages/Oauth/AuthForm/index.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pages/Oauth/AuthForm/index.tsx b/src/pages/Oauth/AuthForm/index.tsx index bf50baa9a0..dd1384333f 100644 --- a/src/pages/Oauth/AuthForm/index.tsx +++ b/src/pages/Oauth/AuthForm/index.tsx @@ -41,13 +41,13 @@ export const OrDivider = () => { const AuthForm: React.FC = ({ formConfig, signInWithEth, flowStatus, disableEth }) => { const { processingSignIn } = flowStatus - const loginMethods = getSupportLoginMethods(formConfig) - - const hasEth = loginMethods.includes(LoginMethod.ETH) - const hasGoogle = loginMethods.includes(LoginMethod.GOOGLE) - const hasEmail = loginMethods.includes(LoginMethod.EMAIL) const nodes = useMemo(() => { + const loginMethods = getSupportLoginMethods(formConfig) + const hasEth = loginMethods.includes(LoginMethod.ETH) + const hasGoogle = loginMethods.includes(LoginMethod.GOOGLE) + const hasEmail = loginMethods.includes(LoginMethod.EMAIL) + const nodes = [] if (hasEmail) nodes.push() if (hasEth) @@ -62,7 +62,7 @@ const AuthForm: React.FC = ({ formConfig, signInWithEth, flowStat ) if (hasGoogle) nodes.push() return nodes - }, [disableEth, flowStatus, hasEmail, hasEth, hasGoogle, processingSignIn, signInWithEth]) + }, [disableEth, flowStatus, formConfig, processingSignIn, signInWithEth]) if (!formConfig) return null const { ui } = formConfig