diff options
author | Stefan Mielke <stefan@tan3.de> | 2023-03-29 13:52:42 +0200 |
---|---|---|
committer | backportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com> | 2023-04-20 08:36:55 +0000 |
commit | 4b455a3407ffc5f91a14651a8486cbacac9211fb (patch) | |
tree | 18c1a3893edaf11e8742d4bf070517bb8d2958ec | |
parent | 78ee42b010f45697dc932678655412ce80e4cb97 (diff) |
use filter instead of guard if clause
Signed-off-by: Stefan Mielke <stefan@tan3.de>
-rw-r--r-- | src/components/AppNavigation/GroupNavigationItem.vue | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/components/AppNavigation/GroupNavigationItem.vue b/src/components/AppNavigation/GroupNavigationItem.vue index 58ac730e..cf7d1dfe 100644 --- a/src/components/AppNavigation/GroupNavigationItem.vue +++ b/src/components/AppNavigation/GroupNavigationItem.vue @@ -153,11 +153,7 @@ export default { */ emailGroup(group) { const emails = [] - group.contacts.forEach(key => { - // break if contact has no email - if (this.contacts[key].email == null) { - return - } + group.contacts.filter(key => this.contacts[key].email !== null).forEach(key => { // The email property could contain "John Doe <john.doe@example.com>", but vcard spec only // allows addr-spec, not name-addr, so to stay compliant, replace everything outside of <> const email = this.contacts[key].email.replace(/(.*<)([^>]*)(>)/g, '$2').trim() |