From e352901f707f71367e2445cf0c9fe988990126e9 Mon Sep 17 00:00:00 2001 From: Kirill Ageychenko Date: Thu, 19 Dec 2024 13:05:58 +0700 Subject: [PATCH] feat: disable testnet chains for non-dev mode --- src/components/modals/providers-bottom-sheet.tsx | 2 +- src/models/provider/provider.ts | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/modals/providers-bottom-sheet.tsx b/src/components/modals/providers-bottom-sheet.tsx index 98bd25ab9..eaa57108f 100644 --- a/src/components/modals/providers-bottom-sheet.tsx +++ b/src/components/modals/providers-bottom-sheet.tsx @@ -34,7 +34,7 @@ export function ProvidersBottomSheet({ } if (disableAllNetworksOption) { - return Provider.getAllNetworks(); + return Provider.getAll().filter(p => p.id !== ALL_NETWORKS_ID); } return Provider.getAll(); diff --git a/src/models/provider/provider.ts b/src/models/provider/provider.ts index c9f39d5de..6a5de9ddc 100644 --- a/src/models/provider/provider.ts +++ b/src/models/provider/provider.ts @@ -195,7 +195,13 @@ class ProviderStore { } getAllNetworks() { - return Object.values(this._data).filter(p => p.id !== ALL_NETWORKS_ID); + return Object.values(this._data).filter(p => { + if (AppStore.isAdditionalFeaturesEnabled) { + return p.id !== ALL_NETWORKS_ID; + } + // disable testnet chains for non-dev mode + return p.id !== ALL_NETWORKS_ID && !p.isTestnet; + }); } getAllEVM() {