diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2021-06-24 13:03:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-24 13:03:03 +0200 |
commit | af1d8cd6ec40d1e46800b7b5658a6cf7d3082e79 (patch) | |
tree | ffc6cd48f3944764706cf7454ca1af84d6df805c | |
parent | 678c41efd7b1b44fddbb175d32aaaa24a390033f (diff) | |
parent | 79bfb618415e99e1a7748a27ef579d145be6e219 (diff) |
Merge pull request #2295 from nextcloud/enh/population
Support population count
-rw-r--r-- | src/components/AppNavigation/CircleNavigationItem.vue | 9 | ||||
-rw-r--r-- | src/models/circle.d.ts | 4 | ||||
-rw-r--r-- | src/models/circle.ts | 7 |
3 files changed, 19 insertions, 1 deletions
diff --git a/src/components/AppNavigation/CircleNavigationItem.vue b/src/components/AppNavigation/CircleNavigationItem.vue index f1059f4f..9b4ec1d6 100644 --- a/src/components/AppNavigation/CircleNavigationItem.vue +++ b/src/components/AppNavigation/CircleNavigationItem.vue @@ -119,7 +119,14 @@ export default { computed: { memberCount() { - return Object.values(this.circle?.members || []).length + const count = Object.keys(this.circle?.members || []).length + + // If member list is empty, let's try the population initial count + if (count === 0 && this.circle.population > 0) { + return this.circle.population + } + + return count }, }, } diff --git a/src/models/circle.d.ts b/src/models/circle.d.ts index a51a56a8..badc2ced 100644 --- a/src/models/circle.d.ts +++ b/src/models/circle.d.ts @@ -59,6 +59,10 @@ export default class Circle { */ set description(text: string); /** + * Circle member count + */ + get population(): any; + /** * Circle ini_initiator the current * user info for this circle */ diff --git a/src/models/circle.ts b/src/models/circle.ts index 3a5880e3..38e0ab0d 100644 --- a/src/models/circle.ts +++ b/src/models/circle.ts @@ -105,6 +105,13 @@ export default class Circle { this._data.description = text } + /** + * Circle member count + */ + get population() { + return this._data.population + } + // MEMBERSHIP ----------------------------------------- /** * Circle ini_initiator the current |