Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import usePagination from 'hooks/usePagination';
import type { IFeatureStrategy } from 'interfaces/strategy';
import { usePlausibleTracker } from 'hooks/usePlausibleTracker';
import { useUiFlag } from 'hooks/useUiFlag';
import { useImpactMetricsEnabled } from 'component/impact-metrics/hooks/useImpactMetricsEnabled';
import { useFeatureReleasePlans } from 'hooks/api/getters/useFeatureReleasePlans/useFeatureReleasePlans';
import { ReleasePlan } from '../../../ReleasePlan/ReleasePlan.tsx';
import { StrategySeparator } from 'component/common/StrategySeparator/StrategySeparator';
Expand Down Expand Up @@ -74,7 +73,6 @@ export const EnvironmentAccordionBody = ({
const { releasePlans, refetch: refetchReleasePlans } =
useFeatureReleasePlans(projectId, featureId, featureEnvironment?.name);
const { trackEvent } = usePlausibleTracker();
const safeguardsEnabled = useImpactMetricsEnabled();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the hook being used in other places. Could we run into issue that impact metrics is disabled and safeguard enabled now? Is that ok?

const [dragItem, setDragItem] = useState<{
id: string;
index: number;
Expand Down Expand Up @@ -232,17 +230,15 @@ export const EnvironmentAccordionBody = ({
</Alert>
</AlertContainer>
) : null}
{safeguardsEnabled ? (
<Suspense fallback={null}>
<LazySafeguard
featureEnvSafeguard={featureEnvironment.safeguards?.[0]}
releasePlan={firstPlan}
environmentName={featureEnvironment.name}
featureId={featureId}
onSafeguardChange={handleSafeguardChange}
/>
</Suspense>
) : null}
<Suspense fallback={null}>
<LazySafeguard
featureEnvSafeguard={featureEnvironment.safeguards?.[0]}
releasePlan={firstPlan}
environmentName={featureEnvironment.name}
featureId={featureId}
onSafeguardChange={handleSafeguardChange}
/>
</Suspense>
<StrategyList>
{releasePlans.map((plan) => (
<StrategyListItem data-type='release-plan' key={plan.id}>
Expand Down
Loading