mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-09 00:18:00 +01:00
fix: strategy targeting numeric also check value field (#6774)
API returns both value and values fields. Empty values array causes ui to think constraint doesnt have a value This PR checks if value field exists and is empty before returning check on values and length
This commit is contained in:
parent
99a32a4265
commit
f29ecaf3c0
@ -18,7 +18,10 @@ interface IFeatureStrategyConstraintsProps {
|
||||
}
|
||||
|
||||
const filterConstraints = (constraint: any) => {
|
||||
if (constraint.hasOwnProperty('values')) {
|
||||
if (
|
||||
constraint.hasOwnProperty('values') &&
|
||||
(!constraint.hasOwnProperty('value') || constraint.value === '')
|
||||
) {
|
||||
return constraint.values && constraint.values.length > 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user