Skip to content

Commit

Permalink
fix: strategy targeting numeric also check value field (#6774)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
daveleek committed Apr 4, 2024
1 parent 99a32a4 commit f29ecaf
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit f29ecaf

Please sign in to comment.