From 61b5ac80c5d066887f0088b12b03278be51e4201 Mon Sep 17 00:00:00 2001 From: Aaron Cook Date: Mon, 10 Jul 2023 09:23:03 +0200 Subject: [PATCH] fix: autoconnect to WC v2 on mobile (#2238) --- src/hooks/wallets/useOnboard.ts | 2 +- src/utils/wallets.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hooks/wallets/useOnboard.ts b/src/hooks/wallets/useOnboard.ts index dfee65672a..85a1a12d04 100644 --- a/src/hooks/wallets/useOnboard.ts +++ b/src/hooks/wallets/useOnboard.ts @@ -118,7 +118,7 @@ export const connectWallet = async ( // On mobile, automatically choose WalletConnect if there is no injected wallet if (!options && isMobile() && !hasInjectedWallet()) { options = { - autoSelect: WalletNames.WALLET_CONNECT, + autoSelect: WalletNames.WALLET_CONNECT_V2, } } diff --git a/src/utils/wallets.ts b/src/utils/wallets.ts index fb952a0074..969732049f 100644 --- a/src/utils/wallets.ts +++ b/src/utils/wallets.ts @@ -24,6 +24,7 @@ export const isWalletRejection = (err: EthersError | Error): boolean => { export const WalletNames = { METAMASK: ProviderLabel.MetaMask, WALLET_CONNECT: WALLET_CONNECT_V1_MODULE_NAME, + WALLET_CONNECT_V2: 'WalletConnect', SAFE_MOBILE_PAIRING: PAIRING_MODULE_LABEL, }