Skip to content

Commit

Permalink
refactor: remove hard coded strings
Browse files Browse the repository at this point in the history
  • Loading branch information
enesozturk committed Jun 28, 2024
1 parent e437f69 commit 9d08ffe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/common/src/utils/ConstantsUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@ export const ConstantsUtil = {
CHAIN: {
EVM: 'evm' as Chain,
SOLANA: 'solana' as Chain
},
CHAIN_NAME: {
EVM: 'Ethereum',
SOLANA: 'Solana'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down

0 comments on commit 9d08ffe

Please sign in to comment.