From fd0489e65402e98454460ae0a25eb895d7b666ba Mon Sep 17 00:00:00 2001 From: Clayton Lin <103287620+clayton1110@users.noreply.github.com> Date: Wed, 1 Jun 2022 10:01:11 -0500 Subject: [PATCH] feat: Suppress the account modal after connect (#3848) fix: Suppress the account modal after connect --- src/components/WalletModal/index.tsx | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/components/WalletModal/index.tsx b/src/components/WalletModal/index.tsx index 1d19afd97d..86f81ecfc1 100644 --- a/src/components/WalletModal/index.tsx +++ b/src/components/WalletModal/index.tsx @@ -127,7 +127,7 @@ export default function WalletModal({ ENSName?: string }) { // important that these are destructed from the account-specific web3-react context - const { active, account, connector, activate, error } = useWeb3React() + const { account, connector, activate, error } = useWeb3React() const [walletView, setWalletView] = useState(WALLET_VIEWS.ACCOUNT) const previousWalletView = usePrevious(walletView) @@ -161,13 +161,6 @@ export default function WalletModal({ }, [walletModalOpen, resetAccountView]) // close modal when a connection is successful - const activePrevious = usePrevious(active) - const connectorPrevious = usePrevious(connector) - useEffect(() => { - if (walletModalOpen && ((active && !activePrevious) || (connector && connector !== connectorPrevious && !error))) { - setWalletView(WALLET_VIEWS.ACCOUNT) - } - }, [setWalletView, active, error, connector, walletModalOpen, activePrevious, connectorPrevious]) const tryActivation = async (connector: AbstractConnector | undefined) => { let name = ''