@@ -53,8 +53,6 @@ export class Web3AuthNoModal extends SafeEventEmitter<Web3AuthNoModalEvents> imp
5353
5454 protected commonJRPCProvider : CommonJRPCProvider | null = null ;
5555
56- protected multiInjectedProviderDiscovery : boolean = true ;
57-
5856 protected connectorStore = createStore < { connectors : IConnector < unknown > [ ] ; setConnectors : ( connectors : IConnector < unknown > [ ] ) => void } > (
5957 ( set ) => ( {
6058 connectors : [ ] as IConnector < unknown > [ ] ,
@@ -92,16 +90,12 @@ export class Web3AuthNoModal extends SafeEventEmitter<Web3AuthNoModalEvents> imp
9290 ...chain ,
9391 } ) ) ,
9492 } ;
95- this . multiInjectedProviderDiscovery = options . multiInjectedProviderDiscovery ?? true ;
9693
9794 // handle cached current chain
9895 this . cachedCurrentChainId = storageAvailable ( this . storage ) ? window [ this . storage ] . getItem ( CURRENT_CHAIN_CACHE_KEY ) : null ;
9996 // use corrected chains from coreOptions
10097 const cachedChain = this . cachedCurrentChainId ? this . coreOptions . chains . find ( ( chain ) => chain . chainId === this . cachedCurrentChainId ) : null ;
10198 this . currentChain = cachedChain || this . coreOptions . chains [ 0 ] ; // use first chain in list as default chain config
102-
103- // TODO: do we need this ?
104- this . subscribeToConnectorEvents = this . subscribeToConnectorEvents . bind ( this ) ;
10599 }
106100
107101 get connected ( ) : boolean {
@@ -265,9 +259,11 @@ export class Web3AuthNoModal extends SafeEventEmitter<Web3AuthNoModalEvents> imp
265259 const connectorFns = [ ...( this . coreOptions . connectors || [ ] ) , authConnector ( ) ] ;
266260 const config = { projectConfig, coreOptions : this . coreOptions } ;
267261
268- // add injected wallets if multi injected provider discovery is enabled
269- if ( this . multiInjectedProviderDiscovery ) {
262+ // add injected connectors
263+ const isMipdEnabled = this . coreOptions . multiInjectedProviderDiscovery ?? true ;
264+ if ( isMipdEnabled ) {
270265 const chainNamespaces = new Set ( this . coreOptions . chains . map ( ( chain ) => chain . chainNamespace ) ) ;
266+ // Solana chains
271267 if ( chainNamespaces . has ( CHAIN_NAMESPACES . SOLANA ) ) {
272268 const { createSolanaMipd, hasSolanaWalletStandardFeatures, walletStandardConnector } = await import ( "@/core/default-solana-connector" ) ;
273269 const solanaMipd = createSolanaMipd ( ) ;
@@ -283,6 +279,7 @@ export class Web3AuthNoModal extends SafeEventEmitter<Web3AuthNoModalEvents> imp
283279 . map ( walletStandardConnector )
284280 ) ;
285281 }
282+ // EVM chains
286283 if ( chainNamespaces . has ( CHAIN_NAMESPACES . EIP155 ) ) {
287284 const { createMipd, injectedEvmConnector } = await import ( "@/core/default-evm-connector" ) ;
288285 const evmMipd = createMipd ( ) ;
@@ -294,11 +291,10 @@ export class Web3AuthNoModal extends SafeEventEmitter<Web3AuthNoModalEvents> imp
294291 connectorFns . push ( ...evmMipd . getProviders ( ) . map ( injectedEvmConnector ) ) ;
295292 }
296293
297- // add wallet connect v2 connector if enabled
298- const { wallet_connect_enabled : walletConnectEnabled , wallet_connect_project_id : walletConnectProjectId } = projectConfig ;
294+ // add WalletConnectV2 connector if enabled
299295 if (
300- walletConnectEnabled &&
301- walletConnectProjectId &&
296+ projectConfig . wallet_connect_enabled &&
297+ projectConfig . wallet_connect_project_id &&
302298 ( chainNamespaces . has ( CHAIN_NAMESPACES . SOLANA ) || chainNamespaces . has ( CHAIN_NAMESPACES . EIP155 ) )
303299 ) {
304300 const { walletConnectV2Connector } = await import ( "@/core/wallet-connect-v2-connector" ) ;
0 commit comments