File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
packages/thirdweb/src/wallets/manager Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " thirdweb " : patch
3+ ---
4+
5+ Allow connecting wallets without setting them as active with useConnect
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ export type ConnectionManager = ReturnType<typeof createConnectionManager>;
2424export type ConnectManagerOptions = {
2525 client : ThirdwebClient ;
2626 accountAbstraction ?: SmartWalletOptions ;
27+ setWalletAsActive ?: boolean ;
2728 onConnect ?: ( wallet : Wallet ) => void ;
2829} ;
2930
@@ -146,7 +147,9 @@ export function createConnectionManager(storage: AsyncStorage) {
146147 // add personal wallet to connected wallets list even if it's not the active one
147148 addConnectedWallet ( wallet ) ;
148149
149- handleSetActiveWallet ( activeWallet ) ;
150+ if ( options ?. setWalletAsActive !== false ) {
151+ handleSetActiveWallet ( activeWallet ) ;
152+ }
150153
151154 wallet . subscribe ( "accountChanged" , async ( ) => {
152155 // We reimplement connect here to prevent memory leaks
You can’t perform that action at this time.
0 commit comments