Skip to content

Commit

Permalink
Fix: default wallet when none are enabled (#1597)
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh authored Jan 26, 2023
1 parent a3036ee commit e84003f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/hooks/wallets/wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,13 @@ export const getSupportedWallets = (chain: ChainInfo): WalletInit[] => {
if (window.Cypress && CYPRESS_MNEMONIC) {
return [e2eWalletModule(chain.rpcUri)]
}
return Object.entries(WALLET_MODULES)
.filter(([key]) => isWalletSupported(chain.disabledWallets, key))
.map(([, module]) => module())
const enabledWallets = Object.entries(WALLET_MODULES).filter(([key]) => isWalletSupported(chain.disabledWallets, key))

if (enabledWallets.length === 0) {
return [WALLET_MODULES.INJECTED()]
}

return enabledWallets.map(([, module]) => module())
}

export const isHardwareWallet = (wallet: ConnectedWallet): boolean => {
Expand Down

0 comments on commit e84003f

Please sign in to comment.