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

fix: should be possible to remove all variants.

This commit is contained in:
Ivar Conradi Østhus 2020-11-04 09:07:02 +01:00
parent 06ac056d2b
commit a8bd6f8063
2 changed files with 6 additions and 1 deletions

View File

@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
The latest version of this document is always available in
[releases][releases-url].
# 3.6.5
- fix: should be possible to remove all variants.
# 3.6.4
- fix: minur ux tweaks

View File

@ -21,7 +21,9 @@ const mapDispatchToProps = (dispatch, ownProps) => ({
const { featureToggle } = ownProps;
const currentVariants = featureToggle.variants || [];
const variants = currentVariants.filter((v, i) => i !== index);
updateWeight(variants, 1000);
if (variants.length > 0) {
updateWeight(variants, 1000);
}
requestUpdateFeatureToggleVariants(featureToggle, variants)(dispatch);
},
updateVariant: (index, variant) => {