1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-11 00:08:30 +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,
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
);
@ -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),