Displaying the highest maxTargets limit

This commit is contained in:
Bruno Alves de Faria committed 2017-06-23 09:07:21 -03:00
1 parent ac2df0b3d0
commit 8ddec37c94
3 files changed
+5 -4

No files matched your search

@@ -25,10 +25,13 @@ export class CriteriaEvaluator {
}
getMaxTargets() {
let result;
let result = 0;
_.each(this.criteria, criterion => {
if (criterion instanceof Criteria.MaxTargetsCriterion) {
result = criterion.options.limit;
const { limit } = criterion.options;
if (limit > result) {
result = limit;
}
}
});
return result;