incyclist-services 1.3.17 → 1.3.18

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.
@@ -93,11 +93,12 @@ let ActivityListService = (() => {
93
93
  return this.preloadObserver;
94
94
  }
95
95
  getPastActivities(filter, props) {
96
- const activities = this.getRepo().search(filter);
96
+ var _a;
97
+ const activities = (_a = this.getRepo().search(filter)) !== null && _a !== void 0 ? _a : [];
97
98
  if (props === null || props === void 0 ? void 0 : props.details) {
98
99
  activities.forEach(ai => this.getRepo().getWithDetails(ai.summary.id));
99
100
  }
100
- return activities;
101
+ return activities.filter(ai => ai.details !== undefined && ai.details !== null);
101
102
  }
102
103
  loadActivities() {
103
104
  return __awaiter(this, void 0, void 0, function* () {
@@ -411,7 +411,7 @@ let ActivityRideService = (() => {
411
411
  getPrevActivityLog(ai, current) {
412
412
  var _a, _b, _c;
413
413
  try {
414
- if (!ai.details) {
414
+ if (!ai.details || !ai.summary) {
415
415
  return null;
416
416
  }
417
417
  const logs = ai.details.logs;
@@ -472,7 +472,7 @@ let ActivityRideService = (() => {
472
472
  return calculate;
473
473
  }
474
474
  catch (err) {
475
- this.logError(err, 'getActivityLog');
475
+ this.logError(err, 'getPrevActivityLog');
476
476
  return null;
477
477
  }
478
478
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incyclist-services",
3
- "version": "1.3.17",
3
+ "version": "1.3.18",
4
4
  "peerDependencies": {
5
5
  "gd-eventlog": "^0.1.26"
6
6
  },