diff --git a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyForm/FeatureStrategyForm.tsx b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyForm/FeatureStrategyForm.tsx
index 08ca64d4c8..f69de73b6b 100644
--- a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyForm/FeatureStrategyForm.tsx
+++ b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyForm/FeatureStrategyForm.tsx
@@ -213,6 +213,7 @@ export const FeatureStrategyForm = ({
}
/>
diff --git a/frontend/src/component/feature/FeatureStrategy/FeatureStrategySegment/FeatureStrategySegment.tsx b/frontend/src/component/feature/FeatureStrategy/FeatureStrategySegment/FeatureStrategySegment.tsx
index 62d1463497..d9e6be585a 100644
--- a/frontend/src/component/feature/FeatureStrategy/FeatureStrategySegment/FeatureStrategySegment.tsx
+++ b/frontend/src/component/feature/FeatureStrategy/FeatureStrategySegment/FeatureStrategySegment.tsx
@@ -13,6 +13,7 @@ import { Divider, styled, Typography } from '@mui/material';
interface IFeatureStrategySegmentProps {
segments: ISegment[];
setSegments: React.Dispatch>;
+ projectId: string;
}
const StyledDivider = styled(Divider)(({ theme }) => ({
@@ -22,6 +23,7 @@ const StyledDivider = styled(Divider)(({ theme }) => ({
export const FeatureStrategySegment = ({
segments: selectedSegments,
setSegments: setSelectedSegments,
+ projectId,
}: IFeatureStrategySegmentProps) => {
const { segments: allSegments } = useSegments();
const { strategySegmentsLimit } = useSegmentLimits();
@@ -35,7 +37,11 @@ export const FeatureStrategySegment = ({
return null;
}
- const unusedSegments = allSegments.filter(segment => {
+ const allSelectableSegments = allSegments.filter(
+ ({ project }) => !project || project === projectId
+ );
+
+ const unusedSegments = allSelectableSegments.filter(segment => {
return !selectedSegments.find(selected => selected.id === segment.id);
});