1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

fix: diff component for ordering (#4552)

This commit is contained in:
Mateusz Kwasniewski 2023-08-23 12:17:59 +02:00 committed by GitHub
parent 31e2260c46
commit f881103701
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,7 +50,10 @@ export const EnvironmentStrategyExecutionOrder = ({
project, project,
actions, actions,
}: IEnvironmentStrategyExecutionOrderProps) => { }: IEnvironmentStrategyExecutionOrderProps) => {
const { feature: featureData } = useFeature(project, feature); const { feature: featureData, loading } = useFeature(project, feature);
if (loading) return null;
const featureEnvironment = featureData.environments.find( const featureEnvironment = featureData.environments.find(
({ name }) => environment === name ({ name }) => environment === name
); );
@ -71,9 +74,11 @@ export const EnvironmentStrategyExecutionOrder = ({
.map(strategy => strategy.id) ?? [], .map(strategy => strategy.id) ?? [],
}; };
const updatedStrategies = change.payload.map(({ id }) => { const updatedStrategies = change.payload
return environmentStrategies.find(s => s.id === id); .map(({ id }) => {
}); return environmentStrategies.find(s => s.id === id);
})
.filter(Boolean);
const data = { const data = {
strategyIds: updatedStrategies.map(strategy => strategy!.id), strategyIds: updatedStrategies.map(strategy => strategy!.id),