diff --git a/packages/stateful/components/wallet/WalletUi.tsx b/packages/stateful/components/wallet/WalletUi.tsx index c968d6781e..e5e133e65e 100644 --- a/packages/stateful/components/wallet/WalletUi.tsx +++ b/packages/stateful/components/wallet/WalletUi.tsx @@ -12,7 +12,6 @@ import { WalletUiWalletList } from './WalletUiWalletList' export const WalletUi = (props: WalletModalProps) => { const { - isWalletDisconnected, isWalletConnecting, isWalletConnected, isWalletError, @@ -46,18 +45,15 @@ export const WalletUi = (props: WalletModalProps) => { } const showWalletConnectQr = isWalletConnecting && qrState === State.Done - const title = - isWalletDisconnected || isWalletError - ? t('title.logInWith') - : isWalletConnecting - ? showWalletConnectQr - ? t('title.scanQrCode') - : current?.walletName.startsWith('web3auth_') - ? t('title.loggingInToService', { service: current.walletPrettyName }) - : t('title.connectingToWallet', { wallet: current?.walletPrettyName }) - : isWalletConnected - ? t('title.loggedIn') - : '' + const title = isWalletConnecting + ? showWalletConnectQr + ? t('title.scanQrCode') + : current?.walletName.startsWith('web3auth_') + ? t('title.loggingInToService', { service: current.walletPrettyName }) + : t('title.connectingToWallet', { wallet: current?.walletPrettyName }) + : isWalletConnected + ? t('title.loggedIn') + : t('title.logInWith') return ( + isConnectingTo(wallet) ? walletRepo.disconnect() : connect(wallet) } - onClick={() => connect(wallet)} variant="secondary" > {!!wallet.walletInfo.logo && ( @@ -99,11 +97,11 @@ export const WalletUiWalletList = ({ isConnectingTo(wallet) && 'animate-pulse' )} contentContainerClassName="flex justify-center items-center" - disabled={ - // Disable if connecting to another wallet. - isWalletConnecting && !isConnectingTo(wallet) + onClick={() => + isConnectingTo(wallet) + ? walletRepo.disconnect() + : connect(wallet) } - onClick={() => connect(wallet)} variant="secondary" > {!!wallet.walletInfo.logo && (