Skip to content

Commit

Permalink
fix: you must specify a web3auth clientId
Browse files Browse the repository at this point in the history
If we haven’t configured any SOCIAL_WALLET_OPTIONS we don’t need to worry about the chain.
  • Loading branch information
compojoom committed Feb 15, 2024
1 parent e078b92 commit 18f58bb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/hooks/wallets/wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 18f58bb

Please sign in to comment.