@vocollege/app 0.0.163 → 0.0.164

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.
@@ -268,8 +268,8 @@ var getImageContact = function (item, width, height) {
268
268
  var _a, _b;
269
269
  if (width === void 0) { width = 400; }
270
270
  if (height === void 0) { height = 400; }
271
- var entity = item.entity || item;
272
- return entity.images && entity.images[0] && ((_a = entity.images[0]) === null || _a === void 0 ? void 0 : _a.url)
271
+ var entity = (item === null || item === void 0 ? void 0 : item.entity) || item;
272
+ return (entity === null || entity === void 0 ? void 0 : entity.images) && entity.images[0] && ((_a = entity.images[0]) === null || _a === void 0 ? void 0 : _a.url)
273
273
  ? "".concat((_b = entity.images[0]) === null || _b === void 0 ? void 0 : _b.url, "?d=").concat(width, "x").concat(height)
274
274
  : "/images/avatar-user.png";
275
275
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vocollege/app",
3
- "version": "0.0.163",
3
+ "version": "0.0.164",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -227,8 +227,8 @@ export const shortenText = (
227
227
  };
228
228
 
229
229
  export const getImageContact = (item: any, width = 400, height = 400) => {
230
- let entity = item.entity || item;
231
- return entity.images && entity.images[0] && entity.images[0]?.url
230
+ let entity = item?.entity || item;
231
+ return entity?.images && entity.images[0] && entity.images[0]?.url
232
232
  ? `${entity.images[0]?.url}?d=${width}x${height}`
233
233
  : "/images/avatar-user.png";
234
234
  };