Skip to content

Commit bd2fbe4

Browse files
committed
fix: skip adding MM connector for solana chain
1 parent 95eb8f7 commit bd2fbe4

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

packages/no-modal/src/connectors/metamask-connector/metamaskConnector.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,7 @@ class MetaMaskConnector extends BaseEvmConnector<void> {
241241
// If the error code is 4902, the network needs to be added
242242
if ((error as { code?: number })?.code === 4902) {
243243
const chainConfig = this.coreOptions.chains.find(
244-
(x) =>
245-
x.chainId === params.chainId && ([CHAIN_NAMESPACES.EIP155, CHAIN_NAMESPACES.SOLANA] as ChainNamespaceType[]).includes(x.chainNamespace)
244+
(x) => x.chainId === params.chainId && ([CHAIN_NAMESPACES.EIP155] as ChainNamespaceType[]).includes(x.chainNamespace)
246245
);
247246
await this.addChain(chainConfig);
248247
await requestSwitchChain();

packages/no-modal/src/noModal.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)