diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/CopyStrategyIconMenu/CopyStrategyIconMenu.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/CopyStrategyIconMenu/CopyStrategyIconMenu.tsx index edde046a42..d1a144cfd6 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/CopyStrategyIconMenu/CopyStrategyIconMenu.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/CopyStrategyIconMenu/CopyStrategyIconMenu.tsx @@ -19,10 +19,10 @@ import useFeatureStrategyApi from 'hooks/api/actions/useFeatureStrategyApi/useFe import useToast from 'hooks/useToast'; import { useFeatureImmutable } from 'hooks/api/getters/useFeature/useFeatureImmutable'; import { formatUnknownError } from 'utils/formatUnknownError'; -import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; import { useChangeRequestAddStrategy } from 'hooks/useChangeRequestAddStrategy'; import { ChangeRequestDialogue } from '../../../../../../../../../changeRequest/ChangeRequestConfirmDialog/ChangeRequestConfirmDialog'; import { CopyStrategyMessage } from '../../../../../../../../../changeRequest/ChangeRequestConfirmDialog/ChangeRequestMessages/CopyStrategyMessage'; +import { useChangeRequestsEnabled } from 'hooks/useChangeRequestsEnabled'; interface ICopyStrategyIconMenuProps { environmentId: string; @@ -51,8 +51,7 @@ export const CopyStrategyIconMenu: VFC = ({ setAnchorEl(null); }; const { hasAccess } = useContext(AccessContext); - const { uiConfig } = useUiConfig(); - const changeRequestsEnabled = uiConfig?.flags?.changeRequests; + const { isChangeRequestConfigured } = useChangeRequestsEnabled(projectId); const { changeRequestDialogDetails, @@ -67,7 +66,7 @@ export const CopyStrategyIconMenu: VFC = ({ environment, copyOf: strategy.id, }; - if (changeRequestsEnabled) { + if (isChangeRequestConfigured(environmentId)) { await onChangeRequestAddStrategy( environment, {