File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
packages/no-modal/src/connectors/auth-connector Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -250,13 +250,12 @@ class AuthConnector extends BaseConnector<AuthLoginParams> {
250250
251251 public async switchChain ( params : { chainId : string } , init = false ) : Promise < void > {
252252 super . checkSwitchChainRequirements ( params , init ) ;
253- const currentChainId = this . provider . chainId ;
254253 // TODO: handle when chainIds are the same
255254 // TODO: need to handle switching to a different chain namespace
256255
257- const chainConfig = this . coreOptions . chains . find ( ( x ) => x . chainId === currentChainId ) ;
258- if ( ! chainConfig ) throw WalletLoginError . connectionError ( "Chain config is not available" ) ;
259- const { chainNamespace } = chainConfig ;
256+ const newChain = this . getChain ( params . chainId ) ;
257+ if ( ! newChain ) throw WalletLoginError . connectionError ( "Chain config is not available" ) ;
258+ const { chainNamespace } = newChain ;
260259
261260 if ( chainNamespace === CHAIN_NAMESPACES . EIP155 ) {
262261 await this . wsEmbedInstance . provider ?. request ( {
You can’t perform that action at this time.
0 commit comments