Explorar o código

changed method to create initials same as others

sato-64bit %!s(int64=4) %!d(string=hai) anos
pai
achega
6289acd109
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  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.username = user.services.oidc.username;
       user.emails = [{ address: email, verified: true }];
       user.emails = [{ address: email, verified: true }];
       const initials = user.services.oidc.fullname
       const initials = user.services.oidc.fullname
-        .match(/\b[a-zA-Z]/g)
-        .join('')
+        .split(/\s+/)
+        .reduce((memo, word) => {
+          return memo + word[0];
+        }, '')
         .toUpperCase();
         .toUpperCase();
       user.profile = {
       user.profile = {
         initials,
         initials,