瀏覽代碼

Fix initials avatar generation (#577)

The ES5 reduce method also needs a initial value. This bug was
introduced in aa974aa54ab6e5b7db7450206d12b44ffb3a0306.
Alexander Sulfrian 9 年之前
父節點
當前提交
3a0a9fa009
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      models/users.js

+ 2 - 2
models/users.js

@@ -68,9 +68,9 @@ Users.helpers({
       return profile.initials;
       return profile.initials;
 
 
     else if (profile.fullname) {
     else if (profile.fullname) {
-      return profile.fullname.split(/\s+/).reduce((memo = '', word) => {
+      return profile.fullname.split(/\s+/).reduce((memo, word) => {
         return memo + word[0];
         return memo + word[0];
-      }).toUpperCase();
+      }, '').toUpperCase();
 
 
     } else {
     } else {
       return this.username[0].toUpperCase();
       return this.username[0].toUpperCase();