1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-21 17:37:01 +01:00

fix infura rpc detection (#16585)

This commit is contained in:
legobeat 2022-11-23 21:30:45 +00:00 committed by GitHub
parent 82dc628fa3
commit 0e573e1e24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,7 +19,8 @@ const mapStateToProps = (state) => {
const providerChainId = provider?.chainId;
const isDeprecatedNetwork =
DEPRECATED_TEST_NET_CHAINIDS.includes(providerChainId);
const isInfuraRpcUrl = provider?.rpcUrl?.match('infura');
const isInfuraRpcUrl =
provider?.rpcUrl && new URL(provider.rpcUrl).host.endsWith('.infura.io');
const showDeprecatedRpcUrlWarning = isDeprecatedNetwork && isInfuraRpcUrl;
return {