Skip to content

Commit

Permalink
fix switch chain build
Browse files Browse the repository at this point in the history
  • Loading branch information
tanguyenvn committed Feb 19, 2025
1 parent eb69e87 commit f6cded5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/no-modal/src/base/adapter/baseAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,8 @@ export abstract class BaseAdapter<T> extends SafeEventEmitter<AdapterEvents> imp

checkSwitchChainRequirements(_params: { chainId: string }, init = false): void {
if (!init && !this.provider) throw WalletLoginError.notConnectedError("Not connected with wallet.");
const coreOptions = this.getCoreOptions?.();
if (!coreOptions?.chainConfigs) throw WalletInitializationError.invalidParams("chainConfigs is required");
const newChainConfig = coreOptions.chainConfigs.find((chainConfig) => chainConfig.chainId === _params.chainId);
if (!this.coreOptions.chainConfigs) throw WalletInitializationError.invalidParams("chainConfigs is required");
const newChainConfig = this.coreOptions.chainConfigs.find((chainConfig) => chainConfig.chainId === _params.chainId);
if (!newChainConfig) throw WalletInitializationError.invalidParams("Invalid chainId");
}

Expand Down

0 comments on commit f6cded5

Please sign in to comment.