@@ -17,7 +17,6 @@ import { WalletConnectV2 } from "../../../lib/connection/WalletConnectV2";
17
17
import { getChainInfo } from "../../../lib/constants/chainInfo" ;
18
18
import {
19
19
getChainPriority ,
20
- TESTNET_CHAIN_IDS ,
21
20
UniWalletSupportedChains
22
21
} from "../../../lib/constants/chains" ;
23
22
import { getSupportedChainIdsFromWalletConnectSession } from "../../../lib/utils/getSupportedChainIdsFromWalletConnectSession" ;
@@ -85,30 +84,21 @@ export const ChainSelector = ({ leftAlign }: ChainSelectorProps) => {
85
84
const walletSupportsChain = useWalletSupportedChains ( ) ;
86
85
87
86
const [ supportedConfigs , unsupportedChains ] = useMemo ( ( ) => {
88
- const { supported, unsupported } = NETWORK_SELECTOR_CHAINS . filter (
89
- ( config ) => {
90
- return (
91
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
92
- TESTNET_CHAIN_IDS . includes ( config . chainId as any )
93
- ) ;
94
- }
95
- )
96
- . sort (
97
- ( { chainId : a } , { chainId : b } ) =>
98
- getChainPriority ( a as ChainId ) - getChainPriority ( b as ChainId )
99
- )
100
- . reduce (
101
- ( acc , config ) => {
102
- const { chainId : chain } = config ;
103
- if ( walletSupportsChain . includes ( chain as ChainId ) ) {
104
- acc . supported . push ( config ) ;
105
- } else {
106
- acc . unsupported . push ( config ) ;
107
- }
108
- return acc ;
109
- } ,
110
- { supported : [ ] , unsupported : [ ] } as Record < string , ProtocolConfig [ ] >
111
- ) ;
87
+ const { supported, unsupported } = NETWORK_SELECTOR_CHAINS . sort (
88
+ ( { chainId : a } , { chainId : b } ) =>
89
+ getChainPriority ( a as ChainId ) - getChainPriority ( b as ChainId )
90
+ ) . reduce (
91
+ ( acc , config ) => {
92
+ const { chainId : chain } = config ;
93
+ if ( walletSupportsChain . includes ( chain as ChainId ) ) {
94
+ acc . supported . push ( config ) ;
95
+ } else {
96
+ acc . unsupported . push ( config ) ;
97
+ }
98
+ return acc ;
99
+ } ,
100
+ { supported : [ ] , unsupported : [ ] } as Record < string , ProtocolConfig [ ] >
101
+ ) ;
112
102
return [ supported , unsupported ] ;
113
103
} , [ walletSupportsChain ] ) ;
114
104
0 commit comments