@@ -603,9 +603,8 @@ export class Web3Auth extends Web3AuthNoModal implements IWeb3AuthModal {
603603 } ) : Promise < void > => {
604604 try {
605605 const connector = this . getConnector ( params . connector as WALLET_CONNECTOR_TYPE , params . loginParams ?. chainNamespace ) ;
606- // auto-connect WalletConnect and non-injected MetaMask in background to generate QR code URI without interfering with user's selected connection
607- const shouldStartConnectionInBackground =
608- connector . name === WALLET_CONNECTORS . WALLET_CONNECT_V2 || ( connector . name === WALLET_CONNECTORS . METAMASK && ! connector . isInjected ) ;
606+ // auto-connect WalletConnect in background to generate QR code URI without interfering with user's selected connection
607+ const shouldStartConnectionInBackground = connector . name === WALLET_CONNECTORS . WALLET_CONNECT_V2 ;
609608 if ( shouldStartConnectionInBackground ) {
610609 const initialChain = this . getInitialChainIdForConnector ( connector ) ;
611610 await connector . connect ( { chainId : initialChain . chainId } ) ;
@@ -648,30 +647,30 @@ export class Web3Auth extends Web3AuthNoModal implements IWeb3AuthModal {
648647 }
649648
650649 // handle MM session refresh if MM is not injected
651- const metamaskConnector = this . getConnector ( WALLET_CONNECTORS . METAMASK ) ;
652- if ( metamaskConnector && ! metamaskConnector . isInjected ) {
653- const status = metamaskConnector ?. status ;
654- log . debug ( "trying refreshing MM session" , visibility , status ) ;
655- if ( visibility && ( status === CONNECTOR_STATUS . READY || status === CONNECTOR_STATUS . CONNECTING ) ) {
656- log . debug ( "refreshing MM session" ) ;
657-
658- // refreshing session for MM whenever modal is opened.
659- try {
660- const initialChain = this . getInitialChainIdForConnector ( metamaskConnector ) ;
661- metamaskConnector . connect ( { chainId : initialChain . chainId } ) ;
662- } catch ( error ) {
663- log . error ( `Error while connecting to MM` , error ) ;
664- }
665- }
666- if (
667- ! visibility &&
668- this . status === CONNECTOR_STATUS . CONNECTED &&
669- ( status === CONNECTOR_STATUS . READY || status === CONNECTOR_STATUS . CONNECTING )
670- ) {
671- log . debug ( "this stops MM connector from trying to reconnect once proposal expires" ) ;
672- metamaskConnector . status = CONNECTOR_STATUS . READY ;
673- }
674- }
650+ // const metamaskConnector = this.getConnector(WALLET_CONNECTORS.METAMASK);
651+ // if (metamaskConnector && !metamaskConnector.isInjected) {
652+ // const status = metamaskConnector?.status;
653+ // log.debug("trying refreshing MM session", visibility, status);
654+ // if (visibility && (status === CONNECTOR_STATUS.READY || status === CONNECTOR_STATUS.CONNECTING)) {
655+ // log.debug("refreshing MM session");
656+
657+ // // refreshing session for MM whenever modal is opened.
658+ // try {
659+ // const initialChain = this.getInitialChainIdForConnector(metamaskConnector);
660+ // metamaskConnector.connect({ chainId: initialChain.chainId });
661+ // } catch (error) {
662+ // log.error(`Error while connecting to MM`, error);
663+ // }
664+ // }
665+ // if (
666+ // !visibility &&
667+ // this.status === CONNECTOR_STATUS.CONNECTED &&
668+ // (status === CONNECTOR_STATUS.READY || status === CONNECTOR_STATUS.CONNECTING)
669+ // ) {
670+ // log.debug("this stops MM connector from trying to reconnect once proposal expires");
671+ // metamaskConnector.status = CONNECTOR_STATUS.READY;
672+ // }
673+ // }
675674 } ;
676675
677676 private getChainNamespaces = ( ) : ChainNamespaceType [ ] => {
0 commit comments