summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan-Christoph Borchardt <hey@jancborchardt.net>2017-09-21 11:38:47 +0200
committerGitHub <noreply@github.com>2017-09-21 11:38:47 +0200
commitf34895414a349864cb1bb6d49438850964cad4ff (patch)
treee41ae161be3de5854af10387a5487e1644706ed9
parent4865cb2a5855a28fe7fefdbca9620075ece7e6c6 (diff)
parentfa3e6ac59ce447c945064c3c75d05daa0cd72850 (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.js3
-rw-r--r--js/tests/filters/counterFormatter_filter.js2
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+');