Skip to content

Commit b3d0140

Browse files
authored
[v4 wallets] Start new session for walletConnect on connect method call (#2683)
1 parent a2423ca commit b3d0140

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

.changeset/weak-badgers-fold.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@thirdweb-dev/wallets": patch
3+
---
4+
5+
Always start new WalletConnect session when calling `connect` method for WalletConnect connector

legacy_packages/wallets/src/evm/connectors/wallet-connect/index.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,9 @@ export class WalletConnectConnector extends WagmiConnector<
124124
const provider = await this.getProvider();
125125
this.setupListeners();
126126

127-
const isChainsStale = await this._isChainsStale();
128-
129-
// If there is an active session with stale chains, disconnect the current session.
130-
if (provider.session && isChainsStale) {
127+
if (provider.session) {
131128
await provider.disconnect();
132-
}
133129

134-
// If there no active session, or the chains are stale, connect.
135-
if (!provider.session || isChainsStale) {
136130
const optionalChains = this.filteredChains
137131
.filter((chain) => chain.chainId !== targetChainId)
138132
.map((optionalChain) => optionalChain.chainId);

0 commit comments

Comments
 (0)