Skip to content

Commit 0cf0fd2

Browse files
authored
fix(wallet): auto connect mobile injected wallet (#7746)
1 parent c4ead9d commit 0cf0fd2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

libs/wallet/src/wagmi/config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { RPC_URLS, VIEM_CHAINS } from '@cowprotocol/common-const'
2-
import { getCurrentChainIdFromUrl } from '@cowprotocol/common-utils'
2+
import { getCurrentChainIdFromUrl, isMobile } from '@cowprotocol/common-utils'
33
import { EvmChains, isEvmChain } from '@cowprotocol/cow-sdk'
44

55
import { createAppKit } from '@reown/appkit/react'
@@ -122,6 +122,8 @@ const reownAppKit = createAppKit({
122122
*/
123123
if (getIsSafeAppIframe()) {
124124
connectWalletById(SAFE_CONNECTOR_ID, 'safe')
125+
} else if (isMobile && window.ethereum) {
126+
connectWalletById('injected', 'injected')
125127
}
126128

127129
bindActiveProvider(wagmiAdapter)

0 commit comments

Comments
 (0)