Skip to content

Commit

Permalink
fix: diff component for ordering (#4552)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew authored Aug 23, 2023
1 parent 31e2260 commit f881103
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ export const EnvironmentStrategyExecutionOrder = ({
project,
actions,
}: IEnvironmentStrategyExecutionOrderProps) => {
const { feature: featureData } = useFeature(project, feature);
const { feature: featureData, loading } = useFeature(project, feature);

if (loading) return null;

const featureEnvironment = featureData.environments.find(
({ name }) => environment === name
);
Expand All @@ -71,9 +74,11 @@ export const EnvironmentStrategyExecutionOrder = ({
.map(strategy => strategy.id) ?? [],
};

const updatedStrategies = change.payload.map(({ id }) => {
return environmentStrategies.find(s => s.id === id);
});
const updatedStrategies = change.payload
.map(({ id }) => {
return environmentStrategies.find(s => s.id === id);
})
.filter(Boolean);

const data = {
strategyIds: updatedStrategies.map(strategy => strategy!.id),
Expand Down

0 comments on commit f881103

Please sign in to comment.