summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2016-04-21 19:24:08 +0200
committerMaxime Quandalle <maxime@quandalle.com>2016-04-21 19:24:08 +0200
commit3a0a9fa0090b1090457ad533a63c2217be1b1c3a (patch)
tree72da3dc02442c9a953180b4642e97fcd658328dc
parent90428e7ba1c0e4185f92dc26b793aff1a9e04bc6 (diff)
downloadwekan-3a0a9fa0090b1090457ad533a63c2217be1b1c3a.tar.gz
wekan-3a0a9fa0090b1090457ad533a63c2217be1b1c3a.tar.bz2
wekan-3a0a9fa0090b1090457ad533a63c2217be1b1c3a.zip
Fix initials avatar generation (#577)
The ES5 reduce method also needs a initial value. This bug was introduced in aa974aa54ab6e5b7db7450206d12b44ffb3a0306.
-rw-r--r--models/users.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/models/users.js b/models/users.js
index 89220a11..4e4a0fac 100644
--- a/models/users.js
+++ b/models/users.js
@@ -68,9 +68,9 @@ Users.helpers({
return profile.initials;
else if (profile.fullname) {
- return profile.fullname.split(/\s+/).reduce((memo = '', word) => {
+ return profile.fullname.split(/\s+/).reduce((memo, word) => {
return memo + word[0];
- }).toUpperCase();
+ }, '').toUpperCase();
} else {
return this.username[0].toUpperCase();