소스 검색

changed method to create initials same as others

sato-64bit 4 년 전
부모
커밋
6289acd109
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      models/users.js

+ 4 - 2
models/users.js

@@ -1009,8 +1009,10 @@ if (Meteor.isServer) {
       user.username = user.services.oidc.username;
       user.emails = [{ address: email, verified: true }];
       const initials = user.services.oidc.fullname
-        .match(/\b[a-zA-Z]/g)
-        .join('')
+        .split(/\s+/)
+        .reduce((memo, word) => {
+          return memo + word[0];
+        }, '')
         .toUpperCase();
       user.profile = {
         initials,