incyclist-services 1.7.120 → 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.
@@ -342,6 +342,7 @@ let ActiveRidesService = (() => {
342
342
  return;
343
343
  const displayItem = {
344
344
  isUser: item.sessionId === this.session,
345
+ isCoach: item.isCoach,
345
346
  name: this.getName(item),
346
347
  diffDistance: this.getDistanceDiff(item),
347
348
  distance: this.getDistance(item),
@@ -355,15 +356,16 @@ let ActiveRidesService = (() => {
355
356
  };
356
357
  displayProps.push(displayItem);
357
358
  });
359
+ const diffValue = (r) => r.diffDistance?.value ?? 0;
358
360
  if (displayProps.length > this.maxLength) {
359
- const absDiff = (r) => Math.abs(r.diffDistance);
361
+ const absDiff = (r) => Math.abs(diffValue(r));
360
362
  displayProps.sort((a, b) => {
361
363
  return absDiff(b) > absDiff(a) ? -1 : 1;
362
364
  });
363
365
  return displayProps.filter((_r, idx) => idx < this.maxLength);
364
366
  }
365
367
  displayProps.sort((a, b) => {
366
- return b.diffDistance > a.diffDistance ? -1 : 1;
368
+ return diffValue(b) > diffValue(a) ? -1 : 1;
367
369
  });
368
370
  return displayProps;
369
371
  }
@@ -685,6 +687,7 @@ let ActiveRidesService = (() => {
685
687
  if (!payload.user) {
686
688
  this.getRemoteActivityDetails(session);
687
689
  }
690
+ this.observer.emit('update', this.getDisplayProps());
688
691
  }
689
692
  catch (err) {
690
693
  this.logError(err, 'onActivityStartEvent');
@@ -762,6 +765,7 @@ let ActiveRidesService = (() => {
762
765
  this.logEvent({ message: 'group ride user joined', active: this.others.length + 1, activityId: this.activity?.id, route: this.activity.route?.title, routeHash: this.getRouteHash(), remote });
763
766
  }
764
767
  }
768
+ this.observer.emit('update', this.getDisplayProps());
765
769
  }
766
770
  catch (err) {
767
771
  this.logError(err, 'onActivityStartEvent');
@@ -784,8 +788,10 @@ let ActiveRidesService = (() => {
784
788
  if (!this.others?.length)
785
789
  return;
786
790
  const idx = this.others.findIndex(ar => ar.sessionId === session);
787
- if (idx !== -1)
788
- this.others.splice(idx, 1);
791
+ if (idx === -1)
792
+ return;
793
+ this.others.splice(idx, 1);
794
+ this.observer.emit('update', this.getDisplayProps());
789
795
  if (!this.isStarted)
790
796
  return;
791
797
  if (this.others.length === 0) {
@@ -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;
@@ -397,7 +396,7 @@ let DevicePairingService = (() => {
397
396
  if (this.isScanning())
398
397
  await this.stopScanning();
399
398
  }
400
- this.state.capabilities.forEach(c => c.connectState = 'waiting');
399
+ (this.state.capabilities ?? []).forEach(c => c.connectState = 'waiting');
401
400
  this.state.waiting = true;
402
401
  }
403
402
  getCapability(capability) {
@@ -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
  }
@@ -1361,7 +1363,7 @@ let DevicePairingService = (() => {
1361
1363
  pauseAdapters(adapters, enforced = false) {
1362
1364
  if (!adapters)
1363
1365
  return;
1364
- const capabilities = this.state.capabilities;
1366
+ const capabilities = this.state.capabilities ?? [];
1365
1367
  capabilities.forEach(c => {
1366
1368
  if (!enforced && !c.selected && c.connectState === 'failed')
1367
1369
  return;
@@ -1372,7 +1374,7 @@ let DevicePairingService = (() => {
1372
1374
  resumeAdapters(adapters = this.state.adapters) {
1373
1375
  if (!adapters?.length)
1374
1376
  return;
1375
- const capabilities = this.state.capabilities;
1377
+ const capabilities = this.state.capabilities ?? [];
1376
1378
  capabilities.forEach(c => {
1377
1379
  if (!c.selected && c.connectState === 'failed')
1378
1380
  return;
@@ -101,6 +101,8 @@ let RidePageService = (() => {
101
101
  prevRidesMode = 'list';
102
102
  gestureHintDismissed = false;
103
103
  prevRidesShown = false;
104
+ nearbyRiders;
105
+ nearbyRidersSubscribed = false;
104
106
  viewTransition = false;
105
107
  constructor() {
106
108
  super('RidePage');
@@ -142,6 +144,7 @@ let RidePageService = (() => {
142
144
  gd_eventlog_1.EventLogger.setGlobalConfig('page', pageLogName);
143
145
  this.gestureHintDismissed = false;
144
146
  this.prevRidesShown = false;
147
+ this.nearbyRidersSubscribed = false;
145
148
  super.openPage();
146
149
  try {
147
150
  const service = this.getRideDisplay();
@@ -888,7 +891,8 @@ let RidePageService = (() => {
888
891
  gestureHint: this.buildGestureHint(startOverlayProps === null),
889
892
  loadIncrement: this.getLoadIncrement(),
890
893
  loadButtonMode: this.getLoadButtonMode(),
891
- prevRides: this.buildPrevRides()
894
+ prevRides: this.buildPrevRides(),
895
+ nearbyRiders: this.nearbyRiders
892
896
  };
893
897
  }
894
898
  buildPrevRides() {
@@ -951,8 +955,55 @@ let RidePageService = (() => {
951
955
  tsStart: row.tsStart
952
956
  };
953
957
  }
958
+ subscribeToNearbyRiders() {
959
+ try {
960
+ if (this.nearbyRidersSubscribed)
961
+ return;
962
+ const observer = this.getActiveRidesObserver();
963
+ if (!observer)
964
+ return;
965
+ observer.on('update', (rows) => {
966
+ this.nearbyRiders = { rows: (rows ?? []).map(row => this.mapNearbyRiderRow(row)) };
967
+ this.rideObserver?.emit('nearby-riders-update', this.nearbyRiders);
968
+ this.updatePageDisplay();
969
+ });
970
+ this.nearbyRidersSubscribed = true;
971
+ }
972
+ catch (err) {
973
+ this.logError(err, 'subscribeToNearbyRiders');
974
+ }
975
+ }
976
+ mapNearbyRiderRow(row) {
977
+ return {
978
+ isUser: !!row.isUser,
979
+ isPaused: !!row.isPaused,
980
+ isCoach: !!row.isCoach,
981
+ name: row.name,
982
+ distance: row.distance ?? { value: 0, unit: '' },
983
+ diffDistance: row.diffDistance ?? { value: 0, unit: '' },
984
+ power: row.power,
985
+ mpower: row.mpower,
986
+ speed: row.speed,
987
+ avatar: row.avatar,
988
+ backgroundColor: row.backgroundColor,
989
+ textColor: row.textColor,
990
+ lat: row.lat,
991
+ lng: row.lng
992
+ };
993
+ }
994
+ getActiveRidesObserver() {
995
+ try {
996
+ const modeService = this.getRideDisplay()?.getRideModeService?.();
997
+ return modeService?.getActiveRidesObserver?.();
998
+ }
999
+ catch (err) {
1000
+ this.logError(err, 'getActiveRidesObserver');
1001
+ return undefined;
1002
+ }
1003
+ }
954
1004
  onDisplayStateUpdate(state) {
955
1005
  this.subscribeToWorkoutObserver();
1006
+ this.subscribeToNearbyRiders();
956
1007
  switch (state) {
957
1008
  case 'Paused':
958
1009
  this.menuProps = this.buildPausedMenuProps();
@@ -83,6 +83,7 @@ let RouteDisplayService = (() => {
83
83
  prevPowerTs;
84
84
  nearbyRiders;
85
85
  _startSettings;
86
+ activeRidesObserver;
86
87
  init(service) {
87
88
  try {
88
89
  super.init(service);
@@ -369,6 +370,7 @@ let RouteDisplayService = (() => {
369
370
  const session = this.getAppInfo().session;
370
371
  try {
371
372
  const observer = this.getActiveRides().init(session);
373
+ this.activeRidesObserver = observer;
372
374
  observer.on('update', (data) => {
373
375
  this.nearbyRiders = data.filter(ar => !ar.isUser);
374
376
  });
@@ -380,11 +382,15 @@ let RouteDisplayService = (() => {
380
382
  cleanupActiveRides() {
381
383
  try {
382
384
  this.getActiveRides().stop();
385
+ delete this.activeRidesObserver;
383
386
  }
384
387
  catch (err) {
385
388
  this.logError(err, 'cleanupActiveRides');
386
389
  }
387
390
  }
391
+ getActiveRidesObserver() {
392
+ return this.activeRidesObserver;
393
+ }
388
394
  savePosition(_startPos) {
389
395
  }
390
396
  getOriginalRoute() {
@@ -339,6 +339,7 @@ let ActiveRidesService = (() => {
339
339
  return;
340
340
  const displayItem = {
341
341
  isUser: item.sessionId === this.session,
342
+ isCoach: item.isCoach,
342
343
  name: this.getName(item),
343
344
  diffDistance: this.getDistanceDiff(item),
344
345
  distance: this.getDistance(item),
@@ -352,15 +353,16 @@ let ActiveRidesService = (() => {
352
353
  };
353
354
  displayProps.push(displayItem);
354
355
  });
356
+ const diffValue = (r) => r.diffDistance?.value ?? 0;
355
357
  if (displayProps.length > this.maxLength) {
356
- const absDiff = (r) => Math.abs(r.diffDistance);
358
+ const absDiff = (r) => Math.abs(diffValue(r));
357
359
  displayProps.sort((a, b) => {
358
360
  return absDiff(b) > absDiff(a) ? -1 : 1;
359
361
  });
360
362
  return displayProps.filter((_r, idx) => idx < this.maxLength);
361
363
  }
362
364
  displayProps.sort((a, b) => {
363
- return b.diffDistance > a.diffDistance ? -1 : 1;
365
+ return diffValue(b) > diffValue(a) ? -1 : 1;
364
366
  });
365
367
  return displayProps;
366
368
  }
@@ -682,6 +684,7 @@ let ActiveRidesService = (() => {
682
684
  if (!payload.user) {
683
685
  this.getRemoteActivityDetails(session);
684
686
  }
687
+ this.observer.emit('update', this.getDisplayProps());
685
688
  }
686
689
  catch (err) {
687
690
  this.logError(err, 'onActivityStartEvent');
@@ -759,6 +762,7 @@ let ActiveRidesService = (() => {
759
762
  this.logEvent({ message: 'group ride user joined', active: this.others.length + 1, activityId: this.activity?.id, route: this.activity.route?.title, routeHash: this.getRouteHash(), remote });
760
763
  }
761
764
  }
765
+ this.observer.emit('update', this.getDisplayProps());
762
766
  }
763
767
  catch (err) {
764
768
  this.logError(err, 'onActivityStartEvent');
@@ -781,8 +785,10 @@ let ActiveRidesService = (() => {
781
785
  if (!this.others?.length)
782
786
  return;
783
787
  const idx = this.others.findIndex(ar => ar.sessionId === session);
784
- if (idx !== -1)
785
- this.others.splice(idx, 1);
788
+ if (idx === -1)
789
+ return;
790
+ this.others.splice(idx, 1);
791
+ this.observer.emit('update', this.getDisplayProps());
786
792
  if (!this.isStarted)
787
793
  return;
788
794
  if (this.others.length === 0) {
@@ -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;
@@ -391,7 +390,7 @@ let DevicePairingService = (() => {
391
390
  if (this.isScanning())
392
391
  await this.stopScanning();
393
392
  }
394
- this.state.capabilities.forEach(c => c.connectState = 'waiting');
393
+ (this.state.capabilities ?? []).forEach(c => c.connectState = 'waiting');
395
394
  this.state.waiting = true;
396
395
  }
397
396
  getCapability(capability) {
@@ -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
  }
@@ -1355,7 +1357,7 @@ let DevicePairingService = (() => {
1355
1357
  pauseAdapters(adapters, enforced = false) {
1356
1358
  if (!adapters)
1357
1359
  return;
1358
- const capabilities = this.state.capabilities;
1360
+ const capabilities = this.state.capabilities ?? [];
1359
1361
  capabilities.forEach(c => {
1360
1362
  if (!enforced && !c.selected && c.connectState === 'failed')
1361
1363
  return;
@@ -1366,7 +1368,7 @@ let DevicePairingService = (() => {
1366
1368
  resumeAdapters(adapters = this.state.adapters) {
1367
1369
  if (!adapters?.length)
1368
1370
  return;
1369
- const capabilities = this.state.capabilities;
1371
+ const capabilities = this.state.capabilities ?? [];
1370
1372
  capabilities.forEach(c => {
1371
1373
  if (!c.selected && c.connectState === 'failed')
1372
1374
  return;
@@ -98,6 +98,8 @@ let RidePageService = (() => {
98
98
  prevRidesMode = 'list';
99
99
  gestureHintDismissed = false;
100
100
  prevRidesShown = false;
101
+ nearbyRiders;
102
+ nearbyRidersSubscribed = false;
101
103
  viewTransition = false;
102
104
  constructor() {
103
105
  super('RidePage');
@@ -139,6 +141,7 @@ let RidePageService = (() => {
139
141
  EventLogger.setGlobalConfig('page', pageLogName);
140
142
  this.gestureHintDismissed = false;
141
143
  this.prevRidesShown = false;
144
+ this.nearbyRidersSubscribed = false;
142
145
  super.openPage();
143
146
  try {
144
147
  const service = this.getRideDisplay();
@@ -885,7 +888,8 @@ let RidePageService = (() => {
885
888
  gestureHint: this.buildGestureHint(startOverlayProps === null),
886
889
  loadIncrement: this.getLoadIncrement(),
887
890
  loadButtonMode: this.getLoadButtonMode(),
888
- prevRides: this.buildPrevRides()
891
+ prevRides: this.buildPrevRides(),
892
+ nearbyRiders: this.nearbyRiders
889
893
  };
890
894
  }
891
895
  buildPrevRides() {
@@ -948,8 +952,55 @@ let RidePageService = (() => {
948
952
  tsStart: row.tsStart
949
953
  };
950
954
  }
955
+ subscribeToNearbyRiders() {
956
+ try {
957
+ if (this.nearbyRidersSubscribed)
958
+ return;
959
+ const observer = this.getActiveRidesObserver();
960
+ if (!observer)
961
+ return;
962
+ observer.on('update', (rows) => {
963
+ this.nearbyRiders = { rows: (rows ?? []).map(row => this.mapNearbyRiderRow(row)) };
964
+ this.rideObserver?.emit('nearby-riders-update', this.nearbyRiders);
965
+ this.updatePageDisplay();
966
+ });
967
+ this.nearbyRidersSubscribed = true;
968
+ }
969
+ catch (err) {
970
+ this.logError(err, 'subscribeToNearbyRiders');
971
+ }
972
+ }
973
+ mapNearbyRiderRow(row) {
974
+ return {
975
+ isUser: !!row.isUser,
976
+ isPaused: !!row.isPaused,
977
+ isCoach: !!row.isCoach,
978
+ name: row.name,
979
+ distance: row.distance ?? { value: 0, unit: '' },
980
+ diffDistance: row.diffDistance ?? { value: 0, unit: '' },
981
+ power: row.power,
982
+ mpower: row.mpower,
983
+ speed: row.speed,
984
+ avatar: row.avatar,
985
+ backgroundColor: row.backgroundColor,
986
+ textColor: row.textColor,
987
+ lat: row.lat,
988
+ lng: row.lng
989
+ };
990
+ }
991
+ getActiveRidesObserver() {
992
+ try {
993
+ const modeService = this.getRideDisplay()?.getRideModeService?.();
994
+ return modeService?.getActiveRidesObserver?.();
995
+ }
996
+ catch (err) {
997
+ this.logError(err, 'getActiveRidesObserver');
998
+ return undefined;
999
+ }
1000
+ }
951
1001
  onDisplayStateUpdate(state) {
952
1002
  this.subscribeToWorkoutObserver();
1003
+ this.subscribeToNearbyRiders();
953
1004
  switch (state) {
954
1005
  case 'Paused':
955
1006
  this.menuProps = this.buildPausedMenuProps();
@@ -77,6 +77,7 @@ let RouteDisplayService = (() => {
77
77
  prevPowerTs;
78
78
  nearbyRiders;
79
79
  _startSettings;
80
+ activeRidesObserver;
80
81
  init(service) {
81
82
  try {
82
83
  super.init(service);
@@ -363,6 +364,7 @@ let RouteDisplayService = (() => {
363
364
  const session = this.getAppInfo().session;
364
365
  try {
365
366
  const observer = this.getActiveRides().init(session);
367
+ this.activeRidesObserver = observer;
366
368
  observer.on('update', (data) => {
367
369
  this.nearbyRiders = data.filter(ar => !ar.isUser);
368
370
  });
@@ -374,11 +376,15 @@ let RouteDisplayService = (() => {
374
376
  cleanupActiveRides() {
375
377
  try {
376
378
  this.getActiveRides().stop();
379
+ delete this.activeRidesObserver;
377
380
  }
378
381
  catch (err) {
379
382
  this.logError(err, 'cleanupActiveRides');
380
383
  }
381
384
  }
385
+ getActiveRidesObserver() {
386
+ return this.activeRidesObserver;
387
+ }
382
388
  savePosition(_startPos) {
383
389
  }
384
390
  getOriginalRoute() {
@@ -78,6 +78,7 @@ export type ActiveRideListDisplayItem = {
78
78
  isUser?: boolean;
79
79
  avatar?: ActiveRideListAvatar;
80
80
  isPaused?: boolean;
81
+ isCoach?: boolean;
81
82
  name: string;
82
83
  distance?: number | {
83
84
  value: number;
@@ -1,8 +1,8 @@
1
1
  import { IncyclistPageService } from "../../base/pages";
2
2
  import { CurrentRideDisplayProps, CurrentRideState, IObserver, RideType } from "../../types";
3
- import { AnyRidePageDisplayProps, GPXRidePageDisplayProps, IRidePageService, PrevRidesRowProps, LoadControlButtonLabels, RideMenuProps, RidePageDisplayProps, StartGateProps, VideoRidePageDisplayProps, WorkoutDashboardLine, WorkoutGestureHint, WorkoutGraphActuals, WorkoutGraphPlan, WorkoutRideMenuProps, WorkoutRidePageDisplayProps, WorkoutUpcomingSteps } from "./types";
3
+ import { AnyRidePageDisplayProps, GPXRidePageDisplayProps, IRidePageService, PrevRidesRowProps, NearbyRiderRowProps, LoadControlButtonLabels, RideMenuProps, RidePageDisplayProps, StartGateProps, VideoRidePageDisplayProps, WorkoutDashboardLine, WorkoutGestureHint, WorkoutGraphActuals, WorkoutGraphPlan, WorkoutRideMenuProps, WorkoutRidePageDisplayProps, WorkoutUpcomingSteps } from "./types";
4
4
  import { ISecretBinding } from "../../api/secret";
5
- import { PrevRidesListDisplayProps } from "../../activities";
5
+ import { ActiveRideListDisplayItem, PrevRidesListDisplayProps } from "../../activities";
6
6
  import type { LoadButtonMode, PowerAdjustmentResult, StepCountdownTick, WorkoutDisplayProperties } from "../../workouts/ride/types";
7
7
  import type { Workout } from "../../workouts/base/model";
8
8
  import type { StepDefinition } from "../../workouts/base/model/types";
@@ -21,6 +21,8 @@ export declare class RidePageService extends IncyclistPageService implements IRi
21
21
  protected prevRidesMode: 'condensed' | 'list';
22
22
  protected gestureHintDismissed: boolean;
23
23
  protected prevRidesShown: boolean;
24
+ protected nearbyRiders?: RidePageDisplayProps['nearbyRiders'];
25
+ protected nearbyRidersSubscribed: boolean;
24
26
  protected viewTransition: boolean;
25
27
  constructor();
26
28
  initPage(): Promise<RideType | undefined>;
@@ -123,11 +125,17 @@ export declare class RidePageService extends IncyclistPageService implements IRi
123
125
  rows: PrevRidesRowProps[];
124
126
  hasMore: boolean;
125
127
  };
128
+ nearbyRiders: {
129
+ rows: NearbyRiderRowProps[];
130
+ };
126
131
  };
127
132
  protected buildPrevRides(): RidePageDisplayProps['prevRides'];
128
133
  protected onPrevRidesTick(): void;
129
134
  getPrevRidesRows(): PrevRidesRowProps[];
130
135
  protected mapPrevRidesRow(row: PrevRidesListDisplayProps): PrevRidesRowProps;
136
+ protected subscribeToNearbyRiders(): void;
137
+ protected mapNearbyRiderRow(row: ActiveRideListDisplayItem): NearbyRiderRowProps;
138
+ protected getActiveRidesObserver(): IObserver | undefined;
131
139
  protected onDisplayStateUpdate(state: CurrentRideState): void;
132
140
  protected updatePageDisplay(): void;
133
141
  protected registerHandlers(observer: IObserver | null | undefined, map: Record<string, any>): void;
@@ -5,6 +5,7 @@ import { CurrentPosition, CurrentRideState, GPXStartOverlayProps, RideViewType,
5
5
  import type { LoadButtonMode, PowerAdjustmentResult } from "../../workouts/ride/types";
6
6
  import type { WorkoutGraphPlanBar } from "../../workouts/base/graph/types";
7
7
  import type { Avatar } from "../../avatars";
8
+ import type { ActiveRideListAvatar } from "../../activities";
8
9
  export interface StartGateProps {
9
10
  title: string;
10
11
  body: string;
@@ -48,6 +49,9 @@ export interface RidePageDisplayProps {
48
49
  rows: PrevRidesRowProps[];
49
50
  hasMore: boolean;
50
51
  };
52
+ nearbyRiders?: {
53
+ rows: NearbyRiderRowProps[];
54
+ };
51
55
  }
52
56
  export interface PrevRidesRowProps {
53
57
  position: number;
@@ -63,6 +67,31 @@ export interface PrevRidesRowProps {
63
67
  lng?: number;
64
68
  tsStart?: number;
65
69
  }
70
+ export interface NearbyRiderRowProps {
71
+ isUser: boolean;
72
+ isPaused: boolean;
73
+ isCoach: boolean;
74
+ name: string;
75
+ distance: {
76
+ value: number;
77
+ unit: string;
78
+ };
79
+ diffDistance: {
80
+ value: number;
81
+ unit: string;
82
+ };
83
+ power?: number;
84
+ mpower?: number;
85
+ speed?: {
86
+ value: number;
87
+ unit: string;
88
+ };
89
+ avatar: ActiveRideListAvatar;
90
+ backgroundColor?: string;
91
+ textColor?: string;
92
+ lat?: number;
93
+ lng?: number;
94
+ }
66
95
  export interface VideoRidePageDisplayProps extends RidePageDisplayProps {
67
96
  video?: VideoDisplayProps;
68
97
  videos?: VideoDisplayProps[];
@@ -8,6 +8,7 @@ import { RouteSettings } from "../../routes/list/cards/types";
8
8
  import { ActiveRideListDisplayItem, ScreenShotInfo } from "../../activities";
9
9
  import { ActivityUpdate, CurrentActivityData } from "../../activities/ride/types";
10
10
  import { RoutePoint } from "../../types";
11
+ import { Observer } from "../../base/types";
11
12
  export declare class RouteDisplayService extends RideModeService {
12
13
  protected prevRequestSlope?: number;
13
14
  protected position?: CurrentPosition;
@@ -18,6 +19,7 @@ export declare class RouteDisplayService extends RideModeService {
18
19
  protected prevPowerTs?: number;
19
20
  protected nearbyRiders?: ActiveRideListDisplayItem[];
20
21
  protected _startSettings?: RouteSettings;
22
+ protected activeRidesObserver?: Observer;
21
23
  init(service: ICurrentRideService): void;
22
24
  getDeviceStartSettings(): {
23
25
  realityFactor: number;
@@ -60,6 +62,7 @@ export declare class RouteDisplayService extends RideModeService {
60
62
  protected checkFinishOptions(position: CurrentPosition): boolean;
61
63
  protected prepareActiveRides(): void;
62
64
  cleanupActiveRides(): void;
65
+ getActiveRidesObserver(): Observer | undefined;
63
66
  protected savePosition(_startPos?: number): void;
64
67
  getOriginalRoute(): Route;
65
68
  getCurrentRoute(): Route;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "incyclist-services",
3
- "version": "1.7.120",
3
+ "version": "1.7.124",
4
4
  "peerDependencies": {
5
5
  "gd-eventlog": "^0.1.27"
6
6
  },
7
7
  "dependencies": {
8
8
  "@garmin/fitsdk": "^21.213.0",
9
9
  "axios": "^1.19.0",
10
- "incyclist-devices": "^3.0.33",
10
+ "incyclist-devices": "^3.0.34",
11
11
  "promise.any": "^2.0.6",
12
12
  "semver": "^7.7.4",
13
13
  "tcx-builder": "^1.1.1",