incyclist-services 1.7.120 → 1.7.121
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/lib/cjs/activities/active-rides/service.js +7 -2
- package/lib/cjs/devices/pairing/service.js +3 -3
- package/lib/cjs/ride/page/service.js +52 -1
- package/lib/cjs/ride/route/RouteDisplayService.js +6 -0
- package/lib/esm/activities/active-rides/service.js +7 -2
- package/lib/esm/devices/pairing/service.js +3 -3
- package/lib/esm/ride/page/service.js +52 -1
- package/lib/esm/ride/route/RouteDisplayService.js +6 -0
- package/lib/types/activities/active-rides/types.d.ts +1 -0
- package/lib/types/ride/page/service.d.ts +10 -2
- package/lib/types/ride/page/types.d.ts +29 -0
- package/lib/types/ride/route/RouteDisplayService.d.ts +3 -0
- package/package.json +2 -2
|
@@ -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),
|
|
@@ -685,6 +686,7 @@ let ActiveRidesService = (() => {
|
|
|
685
686
|
if (!payload.user) {
|
|
686
687
|
this.getRemoteActivityDetails(session);
|
|
687
688
|
}
|
|
689
|
+
this.observer.emit('update', this.getDisplayProps());
|
|
688
690
|
}
|
|
689
691
|
catch (err) {
|
|
690
692
|
this.logError(err, 'onActivityStartEvent');
|
|
@@ -762,6 +764,7 @@ let ActiveRidesService = (() => {
|
|
|
762
764
|
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
765
|
}
|
|
764
766
|
}
|
|
767
|
+
this.observer.emit('update', this.getDisplayProps());
|
|
765
768
|
}
|
|
766
769
|
catch (err) {
|
|
767
770
|
this.logError(err, 'onActivityStartEvent');
|
|
@@ -784,8 +787,10 @@ let ActiveRidesService = (() => {
|
|
|
784
787
|
if (!this.others?.length)
|
|
785
788
|
return;
|
|
786
789
|
const idx = this.others.findIndex(ar => ar.sessionId === session);
|
|
787
|
-
if (idx
|
|
788
|
-
|
|
790
|
+
if (idx === -1)
|
|
791
|
+
return;
|
|
792
|
+
this.others.splice(idx, 1);
|
|
793
|
+
this.observer.emit('update', this.getDisplayProps());
|
|
789
794
|
if (!this.isStarted)
|
|
790
795
|
return;
|
|
791
796
|
if (this.others.length === 0) {
|
|
@@ -397,7 +397,7 @@ let DevicePairingService = (() => {
|
|
|
397
397
|
if (this.isScanning())
|
|
398
398
|
await this.stopScanning();
|
|
399
399
|
}
|
|
400
|
-
this.state.capabilities.forEach(c => c.connectState = 'waiting');
|
|
400
|
+
(this.state.capabilities ?? []).forEach(c => c.connectState = 'waiting');
|
|
401
401
|
this.state.waiting = true;
|
|
402
402
|
}
|
|
403
403
|
getCapability(capability) {
|
|
@@ -1361,7 +1361,7 @@ let DevicePairingService = (() => {
|
|
|
1361
1361
|
pauseAdapters(adapters, enforced = false) {
|
|
1362
1362
|
if (!adapters)
|
|
1363
1363
|
return;
|
|
1364
|
-
const capabilities = this.state.capabilities;
|
|
1364
|
+
const capabilities = this.state.capabilities ?? [];
|
|
1365
1365
|
capabilities.forEach(c => {
|
|
1366
1366
|
if (!enforced && !c.selected && c.connectState === 'failed')
|
|
1367
1367
|
return;
|
|
@@ -1372,7 +1372,7 @@ let DevicePairingService = (() => {
|
|
|
1372
1372
|
resumeAdapters(adapters = this.state.adapters) {
|
|
1373
1373
|
if (!adapters?.length)
|
|
1374
1374
|
return;
|
|
1375
|
-
const capabilities = this.state.capabilities;
|
|
1375
|
+
const capabilities = this.state.capabilities ?? [];
|
|
1376
1376
|
capabilities.forEach(c => {
|
|
1377
1377
|
if (!c.selected && c.connectState === 'failed')
|
|
1378
1378
|
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),
|
|
@@ -682,6 +683,7 @@ let ActiveRidesService = (() => {
|
|
|
682
683
|
if (!payload.user) {
|
|
683
684
|
this.getRemoteActivityDetails(session);
|
|
684
685
|
}
|
|
686
|
+
this.observer.emit('update', this.getDisplayProps());
|
|
685
687
|
}
|
|
686
688
|
catch (err) {
|
|
687
689
|
this.logError(err, 'onActivityStartEvent');
|
|
@@ -759,6 +761,7 @@ let ActiveRidesService = (() => {
|
|
|
759
761
|
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
762
|
}
|
|
761
763
|
}
|
|
764
|
+
this.observer.emit('update', this.getDisplayProps());
|
|
762
765
|
}
|
|
763
766
|
catch (err) {
|
|
764
767
|
this.logError(err, 'onActivityStartEvent');
|
|
@@ -781,8 +784,10 @@ let ActiveRidesService = (() => {
|
|
|
781
784
|
if (!this.others?.length)
|
|
782
785
|
return;
|
|
783
786
|
const idx = this.others.findIndex(ar => ar.sessionId === session);
|
|
784
|
-
if (idx
|
|
785
|
-
|
|
787
|
+
if (idx === -1)
|
|
788
|
+
return;
|
|
789
|
+
this.others.splice(idx, 1);
|
|
790
|
+
this.observer.emit('update', this.getDisplayProps());
|
|
786
791
|
if (!this.isStarted)
|
|
787
792
|
return;
|
|
788
793
|
if (this.others.length === 0) {
|
|
@@ -391,7 +391,7 @@ let DevicePairingService = (() => {
|
|
|
391
391
|
if (this.isScanning())
|
|
392
392
|
await this.stopScanning();
|
|
393
393
|
}
|
|
394
|
-
this.state.capabilities.forEach(c => c.connectState = 'waiting');
|
|
394
|
+
(this.state.capabilities ?? []).forEach(c => c.connectState = 'waiting');
|
|
395
395
|
this.state.waiting = true;
|
|
396
396
|
}
|
|
397
397
|
getCapability(capability) {
|
|
@@ -1355,7 +1355,7 @@ let DevicePairingService = (() => {
|
|
|
1355
1355
|
pauseAdapters(adapters, enforced = false) {
|
|
1356
1356
|
if (!adapters)
|
|
1357
1357
|
return;
|
|
1358
|
-
const capabilities = this.state.capabilities;
|
|
1358
|
+
const capabilities = this.state.capabilities ?? [];
|
|
1359
1359
|
capabilities.forEach(c => {
|
|
1360
1360
|
if (!enforced && !c.selected && c.connectState === 'failed')
|
|
1361
1361
|
return;
|
|
@@ -1366,7 +1366,7 @@ let DevicePairingService = (() => {
|
|
|
1366
1366
|
resumeAdapters(adapters = this.state.adapters) {
|
|
1367
1367
|
if (!adapters?.length)
|
|
1368
1368
|
return;
|
|
1369
|
-
const capabilities = this.state.capabilities;
|
|
1369
|
+
const capabilities = this.state.capabilities ?? [];
|
|
1370
1370
|
capabilities.forEach(c => {
|
|
1371
1371
|
if (!c.selected && c.connectState === 'failed')
|
|
1372
1372
|
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() {
|
|
@@ -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.
|
|
3
|
+
"version": "1.7.121",
|
|
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.
|
|
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",
|