From fe9501eca44657753afb09d5830f159fd3501b39 Mon Sep 17 00:00:00 2001 From: Alexandr Kazachenko Date: Wed, 28 Feb 2024 19:21:54 +0600 Subject: [PATCH] chore: feature-flag for geo-block feature (#3940) --- .../src/modules/application/containers/App/Updaters.tsx | 4 +++- libs/tokens/src/updaters/TokensListsUpdater/index.ts | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/cowswap-frontend/src/modules/application/containers/App/Updaters.tsx b/apps/cowswap-frontend/src/modules/application/containers/App/Updaters.tsx index 9cb381b429..5f50fc025b 100644 --- a/apps/cowswap-frontend/src/modules/application/containers/App/Updaters.tsx +++ b/apps/cowswap-frontend/src/modules/application/containers/App/Updaters.tsx @@ -10,6 +10,7 @@ import { EthFlowDeadlineUpdater, EthFlowSlippageUpdater } from 'modules/swap/sta import { useOnTokenListAddingError } from 'modules/tokensList' import { UsdPricesUpdater } from 'modules/usdAmount' +import { useFeatureFlags } from 'common/hooks/featureFlags/useFeatureFlags' import { TotalSurplusUpdater } from 'common/state/totalSurplusState' import { ApplicationUpdater } from 'common/updaters/ApplicationUpdater' import { CancelReplaceTxUpdater } from 'common/updaters/CancelReplaceTxUpdater' @@ -34,6 +35,7 @@ export function Updaters() { const { chainId, account } = useWalletInfo() const { tokenLists, appCode } = useInjectedWidgetParams() const onTokenListAddingError = useOnTokenListAddingError() + const { isGeoBlockEnabled } = useFeatureFlags() return ( <> @@ -62,7 +64,7 @@ export function Updaters() { - + { - if (isInjectedWidget()) return + if (!isGeoBlockEnabled || isInjectedWidget()) return if (NETWORKS_WITHOUT_RESTRICTIONS.includes(chainId)) { setEnvironment({ useCuratedListOnly: false }) @@ -101,7 +102,7 @@ export function TokensListsUpdater({ chainId: currentChainId }: TokensListsUpdat }) }) // eslint-disable-next-line react-hooks/exhaustive-deps - }, [chainId]) + }, [chainId, isGeoBlockEnabled]) return null }