diff --git a/packages/common/src/utils/ConstantsUtil.ts b/packages/common/src/utils/ConstantsUtil.ts index 9c6c07632f..9cb36aa224 100644 --- a/packages/common/src/utils/ConstantsUtil.ts +++ b/packages/common/src/utils/ConstantsUtil.ts @@ -8,5 +8,9 @@ export const ConstantsUtil = { CHAIN: { EVM: 'evm' as Chain, SOLANA: 'solana' as Chain + }, + CHAIN_NAME: { + EVM: 'Ethereum', + SOLANA: 'Solana' } } diff --git a/packages/scaffold-ui/src/views/w3m-connecting-multi-chain-view/index.ts b/packages/scaffold-ui/src/views/w3m-connecting-multi-chain-view/index.ts index 7d2874bee5..bcd1647df1 100644 --- a/packages/scaffold-ui/src/views/w3m-connecting-multi-chain-view/index.ts +++ b/packages/scaffold-ui/src/views/w3m-connecting-multi-chain-view/index.ts @@ -117,12 +117,12 @@ export class W3mConnectingMultiChainView extends LitElement { private onSwitchNetwork(network: CaipNetwork) { NetworkController.setCaipNetwork(network) - if (network.name === 'Ethereum') { + if (network.name === ConstantsUtil.CHAIN_NAME.EVM) { const connector = this.activeConnector?.providers?.find( provider => provider.chain === ConstantsUtil.CHAIN.EVM ) RouterController.push('ConnectingExternal', { connector }) - } else if (network.name === 'Solana') { + } else if (network.name === ConstantsUtil.CHAIN_NAME.SOLANA) { const connector = this.activeConnector?.providers?.find( provider => provider.chain === ConstantsUtil.CHAIN.SOLANA )