diff --git a/src/state/accountCalculators.ts b/src/state/accountCalculators.ts index 2693a2d610..81a349fd92 100644 --- a/src/state/accountCalculators.ts +++ b/src/state/accountCalculators.ts @@ -1,8 +1,8 @@ import { createSelector } from 'reselect'; import { OnboardingState, OnboardingSteps } from '@/constants/account'; - -import { useEnvFeatures } from '@/hooks/useEnvFeatures'; +import { type DydxNetwork } from '@/constants/networks'; +import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks'; import { getOnboardingGuards, @@ -10,6 +10,7 @@ import { getSubaccountId, getUncommittedOrderClientIds, } from '@/state/accountSelectors'; +import { getSelectedNetwork } from '@/state/appSelectors'; export const calculateOnboardingStep = createSelector( [getOnboardingState, getOnboardingGuards], @@ -91,8 +92,10 @@ export const calculateIsAccountLoading = createSelector( * @description calculate whether positions table should render triggers column */ export const calculateShouldRenderTriggersInPositionsTable = createSelector( - [calculateIsAccountViewOnly], - (isAccountViewOnly: boolean) => !isAccountViewOnly && useEnvFeatures().isSlTpEnabled + [calculateIsAccountViewOnly, getSelectedNetwork], + (isAccountViewOnly: boolean, selectedNetwork: DydxNetwork) => + !isAccountViewOnly && ENVIRONMENT_CONFIG_MAP[selectedNetwork].featureFlags.isSlTpEnabled + // (isAccountViewOnly: boolean) => !isAccountViewOnly && useEnvFeatures().isSlTpEnabled ); /**