Skip to content

Commit

Permalink
(js) Fix validation in Sieve filter editor
Browse files Browse the repository at this point in the history
Fixes #4200
  • Loading branch information
cgx committed Jun 16, 2017
1 parent ca43e7d commit 6c654e0
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -92,8 +92,13 @@
}

function hasRulesAndActions() {
return vm.filter.rules && vm.filter.rules.length > 0 &&
vm.filter.actions && vm.filter.actions.length > 0;
var requirements = [ vm.filter.actions ];
if (vm.filter.match != 'allmessages')
// When matching all messages, no rules are required
requirements.push(vm.filter.rules);
return _.every(requirements, function(a) {
return a && a.length > 0;
});
}

function save(form) {
Expand Down

0 comments on commit 6c654e0

Please sign in to comment.