incyclist-services 1.7.121 → 1.7.124

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.
@@ -356,15 +356,16 @@ let ActiveRidesService = (() => {
356
356
  };
357
357
  displayProps.push(displayItem);
358
358
  });
359
+ const diffValue = (r) => r.diffDistance?.value ?? 0;
359
360
  if (displayProps.length > this.maxLength) {
360
- const absDiff = (r) => Math.abs(r.diffDistance);
361
+ const absDiff = (r) => Math.abs(diffValue(r));
361
362
  displayProps.sort((a, b) => {
362
363
  return absDiff(b) > absDiff(a) ? -1 : 1;
363
364
  });
364
365
  return displayProps.filter((_r, idx) => idx < this.maxLength);
365
366
  }
366
367
  displayProps.sort((a, b) => {
367
- return b.diffDistance > a.diffDistance ? -1 : 1;
368
+ return diffValue(b) > diffValue(a) ? -1 : 1;
368
369
  });
369
370
  return displayProps;
370
371
  }
@@ -428,6 +428,7 @@ let ActivityRideService = (() => {
428
428
  const isFreeRide = startSettings?.type === 'Free-Ride';
429
429
  const showWorkoutSummary = this.activity?.routeType === 'None';
430
430
  const showSave = this.activity !== undefined && !this.isSaveDone;
431
+ const showDelete = this.activity !== undefined && !this.isSaveDone;
431
432
  const showContinue = this.state !== 'completed';
432
433
  const hasGPX = this.activity?.logs?.some((log) => !!log.lat && !!log.lng);
433
434
  const showMap = hasGPX || isFreeRide || (route?.description?.hasGpx);
@@ -440,6 +441,7 @@ let ActivityRideService = (() => {
440
441
  const props = {
441
442
  activity: (0, utils_3.createUIActivityDetails)(this.activity),
442
443
  showSave,
444
+ showDelete,
443
445
  showContinue,
444
446
  showMap,
445
447
  showWorkoutSummary,
@@ -209,9 +209,6 @@ let DevicePairingService = (() => {
209
209
  this.logEvent({ message: 'Stop Pairing (OK)', stillPairing, stillScanning });
210
210
  try {
211
211
  this.pauseAdapters(adapters.filter(a => !adapterFilter.includes(a.udid)));
212
- if (this.isPairing()) {
213
- this.removePairingCallbacks();
214
- }
215
212
  if (this.isScanning()) {
216
213
  this.state.stopRequested = true;
217
214
  await this._stop();
@@ -220,7 +217,9 @@ let DevicePairingService = (() => {
220
217
  this.settings = {};
221
218
  this.state.initialized = false;
222
219
  this.state.waiting = false;
223
- this.state.check = null;
220
+ if (!stillPairing) {
221
+ this.state.check = null;
222
+ }
224
223
  this.state.scan = null;
225
224
  this.state.stopRequested = false;
226
225
  this.state.stopped = true;
@@ -1011,6 +1010,9 @@ let DevicePairingService = (() => {
1011
1010
  this.emit('pairing-done');
1012
1011
  return;
1013
1012
  }
1013
+ if (this.isPairing() && this.state.check?.promise !== undefined) {
1014
+ return;
1015
+ }
1014
1016
  if (this.usage !== 'page' && this.isPairing()) {
1015
1017
  return;
1016
1018
  }
@@ -353,15 +353,16 @@ let ActiveRidesService = (() => {
353
353
  };
354
354
  displayProps.push(displayItem);
355
355
  });
356
+ const diffValue = (r) => r.diffDistance?.value ?? 0;
356
357
  if (displayProps.length > this.maxLength) {
357
- const absDiff = (r) => Math.abs(r.diffDistance);
358
+ const absDiff = (r) => Math.abs(diffValue(r));
358
359
  displayProps.sort((a, b) => {
359
360
  return absDiff(b) > absDiff(a) ? -1 : 1;
360
361
  });
361
362
  return displayProps.filter((_r, idx) => idx < this.maxLength);
362
363
  }
363
364
  displayProps.sort((a, b) => {
364
- return b.diffDistance > a.diffDistance ? -1 : 1;
365
+ return diffValue(b) > diffValue(a) ? -1 : 1;
365
366
  });
366
367
  return displayProps;
367
368
  }
@@ -422,6 +422,7 @@ let ActivityRideService = (() => {
422
422
  const isFreeRide = startSettings?.type === 'Free-Ride';
423
423
  const showWorkoutSummary = this.activity?.routeType === 'None';
424
424
  const showSave = this.activity !== undefined && !this.isSaveDone;
425
+ const showDelete = this.activity !== undefined && !this.isSaveDone;
425
426
  const showContinue = this.state !== 'completed';
426
427
  const hasGPX = this.activity?.logs?.some((log) => !!log.lat && !!log.lng);
427
428
  const showMap = hasGPX || isFreeRide || (route?.description?.hasGpx);
@@ -434,6 +435,7 @@ let ActivityRideService = (() => {
434
435
  const props = {
435
436
  activity: createUIActivityDetails(this.activity),
436
437
  showSave,
438
+ showDelete,
437
439
  showContinue,
438
440
  showMap,
439
441
  showWorkoutSummary,
@@ -203,9 +203,6 @@ let DevicePairingService = (() => {
203
203
  this.logEvent({ message: 'Stop Pairing (OK)', stillPairing, stillScanning });
204
204
  try {
205
205
  this.pauseAdapters(adapters.filter(a => !adapterFilter.includes(a.udid)));
206
- if (this.isPairing()) {
207
- this.removePairingCallbacks();
208
- }
209
206
  if (this.isScanning()) {
210
207
  this.state.stopRequested = true;
211
208
  await this._stop();
@@ -214,7 +211,9 @@ let DevicePairingService = (() => {
214
211
  this.settings = {};
215
212
  this.state.initialized = false;
216
213
  this.state.waiting = false;
217
- this.state.check = null;
214
+ if (!stillPairing) {
215
+ this.state.check = null;
216
+ }
218
217
  this.state.scan = null;
219
218
  this.state.stopRequested = false;
220
219
  this.state.stopped = true;
@@ -1005,6 +1004,9 @@ let DevicePairingService = (() => {
1005
1004
  this.emit('pairing-done');
1006
1005
  return;
1007
1006
  }
1007
+ if (this.isPairing() && this.state.check?.promise !== undefined) {
1008
+ return;
1009
+ }
1008
1010
  if (this.usage !== 'page' && this.isPairing()) {
1009
1011
  return;
1010
1012
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incyclist-services",
3
- "version": "1.7.121",
3
+ "version": "1.7.124",
4
4
  "peerDependencies": {
5
5
  "gd-eventlog": "^0.1.27"
6
6
  },