From 0e573e1e2459239123eddd02efd8dbe453bb2721 Mon Sep 17 00:00:00 2001 From: legobeat <109787230+legobeat@users.noreply.github.com> Date: Wed, 23 Nov 2022 21:30:45 +0000 Subject: [PATCH] fix infura rpc detection (#16585) --- .../loading-network-screen/loading-network-screen.container.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/components/app/loading-network-screen/loading-network-screen.container.js b/ui/components/app/loading-network-screen/loading-network-screen.container.js index 657ff3265..bb5a5d138 100644 --- a/ui/components/app/loading-network-screen/loading-network-screen.container.js +++ b/ui/components/app/loading-network-screen/loading-network-screen.container.js @@ -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 {