From 18f58bbd5b910fa1e5ec5e644031f13825f43481 Mon Sep 17 00:00:00 2001 From: Daniel Dimitrov Date: Thu, 15 Feb 2024 14:34:30 +0100 Subject: [PATCH] fix: you must specify a web3auth clientId MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If we haven’t configured any SOCIAL_WALLET_OPTIONS we don’t need to worry about the chain. --- src/hooks/wallets/wallets.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hooks/wallets/wallets.ts b/src/hooks/wallets/wallets.ts index 65aef984f6..9515dd959d 100644 --- a/src/hooks/wallets/wallets.ts +++ b/src/hooks/wallets/wallets.ts @@ -12,6 +12,7 @@ import walletConnect from '@web3-onboard/walletconnect' import e2eWalletModule from '@/tests/e2e-wallet' import { CGW_NAMES, WALLET_KEYS } from './consts' import MpcModule from '@/services/mpc/SocialLoginModule' +import { SOCIAL_WALLET_OPTIONS } from '@/services/mpc/config' const prefersDarkMode = (): boolean => { return window?.matchMedia('(prefers-color-scheme: dark)')?.matches @@ -70,6 +71,8 @@ export const getSupportedWallets = (chain: ChainInfo): WalletInit[] => { } export const isSocialWalletEnabled = (chain: ChainInfo | undefined): boolean => { + if (Object.keys(SOCIAL_WALLET_OPTIONS).length === 0) return false + if (!chain) return false return chain.disabledWallets.every((label) => label !== CGW_NAMES.SOCIAL_LOGIN)