@salesforcedevs/dx-components 1.2.6-avatar-button-5 → 1.2.6-avatar-button-6

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.6-avatar-button-5",
3
+ "version": "1.2.6-avatar-button-6",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -339,15 +339,14 @@ export default class AvatarButton extends LightningElement {
339
339
 
340
340
  const cleanUserInfo: UserInfo = {};
341
341
  Object.entries(uncleanNextUserInfo).forEach(([key, val]) => {
342
- if (val === "undefined") {
343
- // Clean away bad JSON string data by skipping these.
344
- return;
342
+ // uncleanUserInfo may have undefined values which we don't want in the final product
343
+ if (val && val !== "undefined") {
344
+ // Also a little extra safety to make sure we aren't injecting anything unsafe...
345
+ cleanUserInfo[key as keyof UserInfo] = escapeHtml(val);
345
346
  }
346
- // Also just a little extra safety to make sure we aren't injecting anything unsafe...
347
- cleanUserInfo[key as keyof UserInfo] = escapeHtml(val);
348
347
  });
349
348
 
350
- // Keep the old info for any values not defined on `cleanUserInfo`
349
+ // Keep the old info for any values _not_ defined on `cleanUserInfo`
351
350
  this.userInfo = defaults(cleanUserInfo, this.userInfo);
352
351
  };
353
352