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:
parent
f2d8bc27f0
commit
b5917515d2
@ -82,8 +82,14 @@ const StrategiesList = props => {
|
|||||||
setDelStrategy(index);
|
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));
|
updateEditableStrategies(editableStrategies.filter((_, i) => i !== delStrategy));
|
||||||
|
|
||||||
setDelStrategy(undefined);
|
setDelStrategy(undefined);
|
||||||
setShowDelDialog(null);
|
setShowDelDialog(null);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user