@@ -694,9 +694,9 @@ export class Web3AuthNoModal extends SafeEventEmitter<Web3AuthNoModalEvents> imp
694694 const isMipdEnabled = isExternalWalletEnabled && ( this . coreOptions . multiInjectedProviderDiscovery ?? true ) ;
695695 const chainNamespaces = new Set ( this . coreOptions . chains . map ( ( chain ) => chain . chainNamespace ) ) ;
696696
697- // it's safe to add it here as if there is a MetaMask injected provider, this won't override it
698- // only set headless to true if modal SDK is used, otherwise just use the modal from native Metamask SDK
699- if ( isBrowser ( ) && chainNamespaces . has ( CHAIN_NAMESPACES . EIP155 ) && ! chainNamespaces . has ( CHAIN_NAMESPACES . SOLANA ) ) {
697+ // prioritize using MM connector over injected connector for EVM chains
698+ if ( isBrowser ( ) && chainNamespaces . has ( CHAIN_NAMESPACES . EIP155 ) ) {
699+ // only set headless to true if modal SDK is used, otherwise just use the modal from native Metamask SDK
700700 connectorFns . push ( metaMaskConnector ( modalMode ? { headless : true } : undefined ) ) ;
701701 }
702702
@@ -730,12 +730,6 @@ export class Web3AuthNoModal extends SafeEventEmitter<Web3AuthNoModalEvents> imp
730730 }
731731 }
732732
733- // it's safe to add it here as if there is a MetaMask injected provider, this won't override it
734- // only set headless to true if modal SDK is used, otherwise just use the modal from native Metamask SDK
735- if ( isBrowser ( ) && ( chainNamespaces . has ( CHAIN_NAMESPACES . SOLANA ) || chainNamespaces . has ( CHAIN_NAMESPACES . EIP155 ) ) ) {
736- connectorFns . push ( metaMaskConnector ( modalMode ? { headless : true } : undefined ) ) ;
737- }
738-
739733 // add WalletConnectV2 connector if external wallets are enabled
740734 if ( isBrowser ( ) && isExternalWalletEnabled && ( chainNamespaces . has ( CHAIN_NAMESPACES . SOLANA ) || chainNamespaces . has ( CHAIN_NAMESPACES . EIP155 ) ) ) {
741735 const { walletConnectV2Connector } = await import ( "./connectors/wallet-connect-v2-connector" ) ;
0 commit comments