diff options
author | Jan-Christoph Borchardt <hey@jancborchardt.net> | 2017-09-21 11:38:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-21 11:38:47 +0200 |
commit | f34895414a349864cb1bb6d49438850964cad4ff (patch) | |
tree | e41ae161be3de5854af10387a5487e1644706ed9 | |
parent | 4865cb2a5855a28fe7fefdbca9620075ece7e6c6 (diff) | |
parent | fa3e6ac59ce447c945064c3c75d05daa0cd72850 (diff) |
Merge pull request #350 from nextcloud/no-zero-in-groups
Don't display zero if no contact in groups
-rw-r--r-- | js/filters/counterFormatter_filter.js | 3 | ||||
-rw-r--r-- | js/tests/filters/counterFormatter_filter.js | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/js/filters/counterFormatter_filter.js b/js/filters/counterFormatter_filter.js index a7340265..aa91b6e6 100644 --- a/js/filters/counterFormatter_filter.js +++ b/js/filters/counterFormatter_filter.js @@ -6,6 +6,9 @@ angular.module('contactsApp') if (count > 999) { return '999+'; } + if (count === 0) { + return ''; + } return count; }; }); diff --git a/js/tests/filters/counterFormatter_filter.js b/js/tests/filters/counterFormatter_filter.js index f9cc490f..40a84964 100644 --- a/js/tests/filters/counterFormatter_filter.js +++ b/js/tests/filters/counterFormatter_filter.js @@ -13,7 +13,7 @@ describe('counterFormatter filter', function() { var counterFormatter = $filter('counterFormatter'); expect(counterFormatter(Number.NaN)).to.be.Nan; expect(counterFormatter(15)).to.equal(15); - expect(counterFormatter(0)).to.equal(0); + expect(counterFormatter(0)).to.equal(''); expect(counterFormatter(-5)).to.equal(-5); expect(counterFormatter(999)).to.equal(999); expect(counterFormatter(1000)).to.equal('999+'); |