@salesforcedevs/dx-components 1.2.2-avatar-button-6 → 1.2.2-avatar-button-7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "1.2.2-avatar-button-6",
3
+ "version": "1.2.2-avatar-button-7",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -307,20 +307,26 @@ export default class AvatarButton extends LightningElement {
307
307
  return;
308
308
  }
309
309
 
310
- this.userInfo.avatarImgSrc = userInfo.photos?.thumbnail;
311
- this.userInfo.firstName = userInfo.given_name;
312
- this.userInfo.lastName = userInfo.family_name;
313
- this.userInfo.username = userInfo.preferred_username;
314
- this.userInfo.id = userInfo.user_id;
315
- this.userInfo.orgId = userInfo.organization_id;
310
+ const nextUserInfo: Omit<UserInfo, 'fullName'> = {};
311
+ nextUserInfo.avatarImgSrc = userInfo.photos?.thumbnail;
312
+ nextUserInfo.firstName = userInfo.given_name;
313
+ nextUserInfo.lastName = userInfo.family_name;
314
+ nextUserInfo.username = userInfo.preferred_username;
315
+ nextUserInfo.id = userInfo.user_id;
316
+ nextUserInfo.orgId = userInfo.organization_id;
316
317
 
317
318
  if (userInfo.custom_attributes) {
318
- this.userInfo.company = userInfo.custom_attributes.CompanyName;
319
- this.userInfo.relationship =
319
+ nextUserInfo.company = userInfo.custom_attributes.CompanyName;
320
+ nextUserInfo.relationship =
320
321
  userInfo.custom_attributes.RelationshipToSalesforce;
321
- this.userInfo.role = userInfo.custom_attributes.Role;
322
+ nextUserInfo.role = userInfo.custom_attributes.Role;
322
323
  }
323
324
  // TODO: Consider displaying initials if no photo. Is there always a photo even if just a default one?
325
+
326
+ this.userInfo = {
327
+ ...this.userInfo,
328
+ ...nextUserInfo,
329
+ };
324
330
  };
325
331
 
326
332
  private requestUserInfo = async () => {