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

fix: delete strategy (#262)

This commit is contained in:
Fredrik Strand Oseberg 2021-03-30 15:49:03 +02:00 committed by GitHub
parent f2d8bc27f0
commit b5917515d2

View File

@ -82,8 +82,14 @@ const StrategiesList = props => {
setDelStrategy(index);
};
const removeStrategy = () => {
const removeStrategy = async () => {
const strategy = editableStrategies[delStrategy];
if (!strategy.new) {
await props.saveStrategies(props.configuredStrategies.filter((_, i) => i !== delStrategy));
}
updateEditableStrategies(editableStrategies.filter((_, i) => i !== delStrategy));
setDelStrategy(undefined);
setShowDelDialog(null);
};