Browse Source

Fix initials avatar generation (#577)

The ES5 reduce method also needs a initial value. This bug was
introduced in aa974aa54ab6e5b7db7450206d12b44ffb3a0306.
Alexander Sulfrian 9 years ago
parent
commit
3a0a9fa009
1 changed files with 2 additions and 2 deletions
  1. 2 2
      models/users.js

+ 2 - 2
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();