incyclist-services 1.9.27 → 1.9.28
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/routes/library/service.js +1 -1
- package/lib/cjs/workouts/index.js +1 -0
- package/lib/cjs/workouts/list/service.js +0 -16
- package/lib/cjs/workouts/page/base/service.js +332 -0
- package/lib/cjs/workouts/page/base/types.js +2 -0
- package/lib/cjs/workouts/page/desktop/service.js +443 -0
- package/lib/cjs/workouts/page/desktop/types.js +2 -0
- package/lib/cjs/workouts/page/index.js +17 -15
- package/lib/cjs/workouts/page/mobile/service.js +256 -0
- package/lib/cjs/workouts/page/mobile/types.js +2 -0
- package/lib/cjs/workouts/prompt/index.js +18 -0
- package/lib/cjs/workouts/prompt/service.js +132 -0
- package/lib/cjs/workouts/prompt/types.js +2 -0
- package/lib/esm/routes/library/service.js +1 -1
- package/lib/esm/workouts/index.js +1 -0
- package/lib/esm/workouts/list/service.js +0 -16
- package/lib/esm/workouts/page/base/service.js +329 -0
- package/lib/esm/workouts/page/base/types.js +1 -0
- package/lib/esm/workouts/page/desktop/service.js +440 -0
- package/lib/esm/workouts/page/desktop/types.js +1 -0
- package/lib/esm/workouts/page/index.js +12 -1
- package/lib/esm/workouts/page/mobile/service.js +253 -0
- package/lib/esm/workouts/page/mobile/types.js +1 -0
- package/lib/esm/workouts/prompt/index.js +2 -0
- package/lib/esm/workouts/prompt/service.js +128 -0
- package/lib/esm/workouts/prompt/types.js +1 -0
- package/lib/types/workouts/index.d.ts +1 -0
- package/lib/types/workouts/list/service.d.ts +0 -1
- package/lib/types/workouts/page/base/service.d.ts +41 -0
- package/lib/types/workouts/page/base/types.d.ts +37 -0
- package/lib/types/workouts/page/desktop/service.d.ts +61 -0
- package/lib/types/workouts/page/desktop/types.d.ts +42 -0
- package/lib/types/workouts/page/index.d.ts +6 -1
- package/lib/types/workouts/page/mobile/service.d.ts +31 -0
- package/lib/types/workouts/page/mobile/types.d.ts +66 -0
- package/lib/types/workouts/page/types.d.ts +3 -99
- package/lib/types/workouts/prompt/index.d.ts +2 -0
- package/lib/types/workouts/prompt/service.d.ts +17 -0
- package/lib/types/workouts/prompt/types.d.ts +9 -0
- package/lib/types/workouts/types.d.ts +1 -0
- package/package.json +5 -5
|
@@ -495,7 +495,7 @@ let RouteLibraryScannerService = (() => {
|
|
|
495
495
|
}
|
|
496
496
|
countFailedFolder(ctx, err, folderName) {
|
|
497
497
|
ctx.progress.failedFolders++;
|
|
498
|
-
this.
|
|
498
|
+
this.logEvent({ message: 'scanFolder failed', folderName, reason: err.message });
|
|
499
499
|
this.emitScanProgress(ctx);
|
|
500
500
|
}
|
|
501
501
|
emitScanProgress(ctx) {
|
|
@@ -20,6 +20,7 @@ __exportStar(require("./ride"), exports);
|
|
|
20
20
|
__exportStar(require("./base/model"), exports);
|
|
21
21
|
__exportStar(require("./base/graph"), exports);
|
|
22
22
|
__exportStar(require("./page"), exports);
|
|
23
|
+
__exportStar(require("./prompt"), exports);
|
|
23
24
|
var calendar_1 = require("./calendar");
|
|
24
25
|
Object.defineProperty(exports, "WorkoutCalendarService", { enumerable: true, get: function () { return calendar_1.WorkoutCalendarService; } });
|
|
25
26
|
Object.defineProperty(exports, "useWorkoutCalendar", { enumerable: true, get: function () { return calendar_1.useWorkoutCalendar; } });
|
|
@@ -249,9 +249,6 @@ let WorkoutListService = (() => {
|
|
|
249
249
|
this.getWorkoutCalendar().once('scheduled', (event) => {
|
|
250
250
|
this.scheduledToday = event;
|
|
251
251
|
this.getAppState().setState('scheduledToday', event.workout.id);
|
|
252
|
-
if (!this.isMobile()) {
|
|
253
|
-
this.getAppState().setPersistedState('page', 'workouts');
|
|
254
|
-
}
|
|
255
252
|
});
|
|
256
253
|
this.getWorkoutCalendar().init().catch(err => { this.logError(err, 'preload'); });
|
|
257
254
|
this.preloadObserver.start()
|
|
@@ -353,16 +350,6 @@ let WorkoutListService = (() => {
|
|
|
353
350
|
getScheduledWorkouts(scheduled) {
|
|
354
351
|
const schedList = new cardlist_1.CardList('scheduled', 'Scheduled Workouts');
|
|
355
352
|
scheduled.forEach(w => schedList.add(new ScheduledWorkoutCard_1.ScheduledWorkoutCard(w)));
|
|
356
|
-
if (!this.isMobile()) {
|
|
357
|
-
const today = this.getAppState().getState('scheduledToday');
|
|
358
|
-
if (today) {
|
|
359
|
-
schedList.getCards().forEach(c => {
|
|
360
|
-
if (c.getId() === today) {
|
|
361
|
-
c.select();
|
|
362
|
-
}
|
|
363
|
-
});
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
353
|
const newList = (this.scheduledList === undefined || this.scheduledList === null);
|
|
367
354
|
if (newList) {
|
|
368
355
|
this.scheduledList = schedList;
|
|
@@ -698,9 +685,6 @@ let WorkoutListService = (() => {
|
|
|
698
685
|
getAppState() {
|
|
699
686
|
return (0, appstate_1.useAppState)();
|
|
700
687
|
}
|
|
701
|
-
isMobile() {
|
|
702
|
-
return this.getBindings()?.appInfo?.getChannel() === 'mobile';
|
|
703
|
-
}
|
|
704
688
|
getBindings() {
|
|
705
689
|
return (0, api_1.getBindings)();
|
|
706
690
|
}
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
3
|
+
var useValue = arguments.length > 2;
|
|
4
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
5
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
6
|
+
}
|
|
7
|
+
return useValue ? value : void 0;
|
|
8
|
+
};
|
|
9
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
10
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
11
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
12
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
13
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
14
|
+
var _, done = false;
|
|
15
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
16
|
+
var context = {};
|
|
17
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
18
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
19
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
20
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
21
|
+
if (kind === "accessor") {
|
|
22
|
+
if (result === void 0) continue;
|
|
23
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
24
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
25
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
26
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
27
|
+
}
|
|
28
|
+
else if (_ = accept(result)) {
|
|
29
|
+
if (kind === "field") initializers.unshift(_);
|
|
30
|
+
else descriptor[key] = _;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
34
|
+
done = true;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.WorkoutListPageService = void 0;
|
|
38
|
+
const pages_1 = require("../../../base/pages");
|
|
39
|
+
const decorators_1 = require("../../../base/decorators");
|
|
40
|
+
const settings_1 = require("../../../settings");
|
|
41
|
+
const calendar_1 = require("../../calendar");
|
|
42
|
+
const service_1 = require("../../list/service");
|
|
43
|
+
const devices_1 = require("../../../devices");
|
|
44
|
+
const routes_1 = require("../../../routes");
|
|
45
|
+
let WorkoutListPageService = (() => {
|
|
46
|
+
let _classSuper = pages_1.IncyclistPageService;
|
|
47
|
+
let _instanceExtraInitializers = [];
|
|
48
|
+
let _getDevicePairing_decorators;
|
|
49
|
+
let _getWorkoutList_decorators;
|
|
50
|
+
let _getRouteList_decorators;
|
|
51
|
+
let _getWorkoutCalendar_decorators;
|
|
52
|
+
let _getUserSettings_decorators;
|
|
53
|
+
return class WorkoutListPageService extends _classSuper {
|
|
54
|
+
static {
|
|
55
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
56
|
+
_getDevicePairing_decorators = [decorators_1.Injectable];
|
|
57
|
+
_getWorkoutList_decorators = [decorators_1.Injectable];
|
|
58
|
+
_getRouteList_decorators = [decorators_1.Injectable];
|
|
59
|
+
_getWorkoutCalendar_decorators = [decorators_1.Injectable];
|
|
60
|
+
_getUserSettings_decorators = [decorators_1.Injectable];
|
|
61
|
+
__esDecorate(this, null, _getDevicePairing_decorators, { kind: "method", name: "getDevicePairing", static: false, private: false, access: { has: obj => "getDevicePairing" in obj, get: obj => obj.getDevicePairing }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
62
|
+
__esDecorate(this, null, _getWorkoutList_decorators, { kind: "method", name: "getWorkoutList", static: false, private: false, access: { has: obj => "getWorkoutList" in obj, get: obj => obj.getWorkoutList }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
63
|
+
__esDecorate(this, null, _getRouteList_decorators, { kind: "method", name: "getRouteList", static: false, private: false, access: { has: obj => "getRouteList" in obj, get: obj => obj.getRouteList }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
64
|
+
__esDecorate(this, null, _getWorkoutCalendar_decorators, { kind: "method", name: "getWorkoutCalendar", static: false, private: false, access: { has: obj => "getWorkoutCalendar" in obj, get: obj => obj.getWorkoutCalendar }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
65
|
+
__esDecorate(this, null, _getUserSettings_decorators, { kind: "method", name: "getUserSettings", static: false, private: false, access: { has: obj => "getUserSettings" in obj, get: obj => obj.getUserSettings }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
66
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
67
|
+
}
|
|
68
|
+
detailWorkoutId = (__runInitializers(this, _instanceExtraInitializers), null);
|
|
69
|
+
listObserver;
|
|
70
|
+
listUpdateHandler = this.emitPageUpdate.bind(this);
|
|
71
|
+
calendarUpdateHandler = this.emitPageUpdate.bind(this);
|
|
72
|
+
constructor() {
|
|
73
|
+
super('WorkoutListPage');
|
|
74
|
+
}
|
|
75
|
+
getRideNavigationState() {
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
openPage() {
|
|
79
|
+
try {
|
|
80
|
+
super.openPage();
|
|
81
|
+
this.logEvent({ message: 'page shown', page: 'Workouts' });
|
|
82
|
+
const { observer } = this.getWorkoutList().open();
|
|
83
|
+
this.listObserver = observer;
|
|
84
|
+
this.listObserver?.on('started', this.listUpdateHandler);
|
|
85
|
+
this.listObserver?.on('loading', this.listUpdateHandler);
|
|
86
|
+
this.listObserver?.on('loaded', this.listUpdateHandler);
|
|
87
|
+
this.listObserver?.on('updated', this.listUpdateHandler);
|
|
88
|
+
this.getWorkoutCalendar().on('updated', this.calendarUpdateHandler);
|
|
89
|
+
this.emitPageUpdate();
|
|
90
|
+
}
|
|
91
|
+
catch (err) {
|
|
92
|
+
this.logError(err, 'openPage');
|
|
93
|
+
}
|
|
94
|
+
return this.getPageObserver();
|
|
95
|
+
}
|
|
96
|
+
closePage() {
|
|
97
|
+
try {
|
|
98
|
+
this.getWorkoutList().close();
|
|
99
|
+
this.listObserver?.off('started', this.listUpdateHandler);
|
|
100
|
+
this.listObserver?.off('loading', this.listUpdateHandler);
|
|
101
|
+
this.listObserver?.off('loaded', this.listUpdateHandler);
|
|
102
|
+
this.listObserver?.off('updated', this.listUpdateHandler);
|
|
103
|
+
this.getWorkoutCalendar().off('updated', this.calendarUpdateHandler);
|
|
104
|
+
delete this.listObserver;
|
|
105
|
+
this.logEvent({ message: 'page closed', page: 'Workouts' });
|
|
106
|
+
super.closePage();
|
|
107
|
+
}
|
|
108
|
+
catch (err) {
|
|
109
|
+
this.logError(err, 'closePage');
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
getWorkoutDetailsProps(id) {
|
|
113
|
+
try {
|
|
114
|
+
const card = this.findWorkoutCard(id, { includeScheduled: true });
|
|
115
|
+
if (!card)
|
|
116
|
+
return null;
|
|
117
|
+
const workout = card.getData();
|
|
118
|
+
const settingsProps = card.openSettings();
|
|
119
|
+
const isScheduled = card.getCardType() === 'ScheduledWorkout';
|
|
120
|
+
return {
|
|
121
|
+
id,
|
|
122
|
+
title: card.getTitle(),
|
|
123
|
+
description: workout?.description,
|
|
124
|
+
duration: settingsProps.duration,
|
|
125
|
+
workout,
|
|
126
|
+
ftp: settingsProps.settings?.ftp,
|
|
127
|
+
ftpRequired: settingsProps.ftpRequired,
|
|
128
|
+
useErgMode: settingsProps.settings?.useErgMode,
|
|
129
|
+
canStart: settingsProps.canStart,
|
|
130
|
+
canStartWorkoutOnly: settingsProps.canStartWorkoutOnly,
|
|
131
|
+
groups: settingsProps.categories,
|
|
132
|
+
group: settingsProps.category,
|
|
133
|
+
canDelete: card.canDelete(),
|
|
134
|
+
isScheduled,
|
|
135
|
+
date: isScheduled ? settingsProps.date : undefined,
|
|
136
|
+
attachedRoute: this.getAttachedRouteProps()
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
catch (err) {
|
|
140
|
+
this.logError(err, 'getWorkoutDetailsProps');
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
getAttachedRouteProps() {
|
|
145
|
+
try {
|
|
146
|
+
const route = this.getRouteList().getSelected();
|
|
147
|
+
if (!route)
|
|
148
|
+
return null;
|
|
149
|
+
return { id: route.description?.id, title: route.title };
|
|
150
|
+
}
|
|
151
|
+
catch (err) {
|
|
152
|
+
this.logError(err, 'getAttachedRouteProps');
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
onOpenDetails(id) {
|
|
157
|
+
try {
|
|
158
|
+
this.detailWorkoutId = id;
|
|
159
|
+
this.logEvent({ message: 'details opened', id });
|
|
160
|
+
this.emitPageUpdate();
|
|
161
|
+
}
|
|
162
|
+
catch (err) {
|
|
163
|
+
this.logError(err, 'onOpenDetails');
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
onCloseDetails() {
|
|
167
|
+
try {
|
|
168
|
+
this.detailWorkoutId = null;
|
|
169
|
+
this.logEvent({ message: 'details closed' });
|
|
170
|
+
this.emitPageUpdate();
|
|
171
|
+
}
|
|
172
|
+
catch (err) {
|
|
173
|
+
this.logError(err, 'onCloseDetails');
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
onSetFtp(ftp) {
|
|
177
|
+
try {
|
|
178
|
+
const current = this.getWorkoutList().getStartSettings();
|
|
179
|
+
this.getWorkoutList().setStartSettings({ ...current, ftp });
|
|
180
|
+
this.emitPageUpdate();
|
|
181
|
+
}
|
|
182
|
+
catch (err) {
|
|
183
|
+
this.logError(err, 'onSetFtp');
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
onSetErgMode(enabled) {
|
|
187
|
+
try {
|
|
188
|
+
const current = this.getWorkoutList().getStartSettings();
|
|
189
|
+
this.getWorkoutList().setStartSettings({ ...current, useErgMode: enabled });
|
|
190
|
+
this.emitPageUpdate();
|
|
191
|
+
}
|
|
192
|
+
catch (err) {
|
|
193
|
+
this.logError(err, 'onSetErgMode');
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
onChangeGroup(id, group) {
|
|
197
|
+
try {
|
|
198
|
+
const card = this.findWorkoutCard(id);
|
|
199
|
+
card?.move(group);
|
|
200
|
+
this.emitPageUpdate();
|
|
201
|
+
}
|
|
202
|
+
catch (err) {
|
|
203
|
+
this.logError(err, 'onChangeGroup');
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
async onDelete(id) {
|
|
207
|
+
try {
|
|
208
|
+
const observer = this.getWorkoutList().deleteWorkout(id);
|
|
209
|
+
const deleted = await observer.wait();
|
|
210
|
+
this.emitPageUpdate();
|
|
211
|
+
return !!deleted;
|
|
212
|
+
}
|
|
213
|
+
catch (err) {
|
|
214
|
+
this.logError(err, 'onDelete');
|
|
215
|
+
return false;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
onStart(id, opts) {
|
|
219
|
+
try {
|
|
220
|
+
const card = this.findWorkoutCard(id, { includeScheduled: true });
|
|
221
|
+
if (!card)
|
|
222
|
+
return;
|
|
223
|
+
const service = this.getWorkoutList();
|
|
224
|
+
const pairing = this.getDevicePairing();
|
|
225
|
+
const settings = service.getStartSettings() ?? {};
|
|
226
|
+
card.select({ ...settings, noRoute: opts?.noRoute });
|
|
227
|
+
this.logEvent({ message: 'Attempting to start a ride', id, ...settings, noRoute: opts?.noRoute, readyToStart: pairing.isReadyToStart(), });
|
|
228
|
+
this.detailWorkoutId = null;
|
|
229
|
+
service.close();
|
|
230
|
+
const next = this.getRideTarget(pairing.isReadyToStart());
|
|
231
|
+
const state = this.getRideNavigationState();
|
|
232
|
+
if (state === undefined)
|
|
233
|
+
this.moveTo(next);
|
|
234
|
+
else
|
|
235
|
+
this.moveTo(next, true, state);
|
|
236
|
+
}
|
|
237
|
+
catch (err) {
|
|
238
|
+
this.logError(err, 'onStart');
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
onMarkForRoute(id) {
|
|
242
|
+
try {
|
|
243
|
+
const card = this.findWorkoutCard(id, { includeScheduled: true });
|
|
244
|
+
if (!card)
|
|
245
|
+
return;
|
|
246
|
+
const settings = this.getWorkoutList().getStartSettings();
|
|
247
|
+
card.select({ ...settings, noRoute: false });
|
|
248
|
+
this.detailWorkoutId = null;
|
|
249
|
+
this.emitPageUpdate();
|
|
250
|
+
}
|
|
251
|
+
catch (err) {
|
|
252
|
+
this.logError(err, 'onMarkForRoute');
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
onClearSelection() {
|
|
256
|
+
try {
|
|
257
|
+
this.getWorkoutList().unselect();
|
|
258
|
+
this.emitPageUpdate();
|
|
259
|
+
}
|
|
260
|
+
catch (err) {
|
|
261
|
+
this.logError(err, 'onClearSelection');
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
onClearRouteSelection() {
|
|
265
|
+
try {
|
|
266
|
+
this.getRouteList().unselect();
|
|
267
|
+
this.emitPageUpdate();
|
|
268
|
+
}
|
|
269
|
+
catch (err) {
|
|
270
|
+
this.logError(err, 'onClearRouteSelection');
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
findWorkoutCard(id, opts) {
|
|
274
|
+
const includeScheduled = opts?.includeScheduled ?? false;
|
|
275
|
+
const lists = this.getWorkoutList().getLists(false) ?? [];
|
|
276
|
+
const regularLists = lists.filter(l => l.getId() !== 'scheduled');
|
|
277
|
+
const scheduledLists = includeScheduled ? lists.filter(l => l.getId() === 'scheduled') : [];
|
|
278
|
+
const orderedLists = [...regularLists, ...scheduledLists];
|
|
279
|
+
for (const list of orderedLists) {
|
|
280
|
+
const card = list.getCards().find(c => c.getId() === id);
|
|
281
|
+
if (card)
|
|
282
|
+
return card;
|
|
283
|
+
}
|
|
284
|
+
return undefined;
|
|
285
|
+
}
|
|
286
|
+
getScheduledTodayWorkoutId() {
|
|
287
|
+
try {
|
|
288
|
+
const today = this.getWorkoutCalendar().getScheduledToday();
|
|
289
|
+
return today?.workout?.id ?? today?.workoutId ?? null;
|
|
290
|
+
}
|
|
291
|
+
catch (err) {
|
|
292
|
+
this.logError(err, 'getScheduledTodayWorkoutId');
|
|
293
|
+
return null;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
formatDuration(duration) {
|
|
297
|
+
if (duration === undefined || duration === null)
|
|
298
|
+
return '';
|
|
299
|
+
if (duration < 120)
|
|
300
|
+
return `${duration.toFixed(0)}s`;
|
|
301
|
+
if (duration % 60 === 0)
|
|
302
|
+
return `${duration / 60}min`;
|
|
303
|
+
const secVal = duration % 60;
|
|
304
|
+
const minVal = (duration - secVal) / 60 % 60;
|
|
305
|
+
const h = Math.floor((duration - secVal - minVal * 60) / 3600);
|
|
306
|
+
const sec = secVal < 10 ? `0${secVal}` : secVal;
|
|
307
|
+
const min = minVal < 10 ? `0${minVal}` : minVal;
|
|
308
|
+
if (h > 0)
|
|
309
|
+
return `${h}:${min}:${sec}`;
|
|
310
|
+
return `${min}:${sec}`;
|
|
311
|
+
}
|
|
312
|
+
emitPageUpdate() {
|
|
313
|
+
this.getPageObserver()?.emit('page-update');
|
|
314
|
+
}
|
|
315
|
+
getDevicePairing() {
|
|
316
|
+
return (0, devices_1.useDevicePairing)();
|
|
317
|
+
}
|
|
318
|
+
getWorkoutList() {
|
|
319
|
+
return (0, service_1.useWorkoutList)();
|
|
320
|
+
}
|
|
321
|
+
getRouteList() {
|
|
322
|
+
return (0, routes_1.useRouteList)();
|
|
323
|
+
}
|
|
324
|
+
getWorkoutCalendar() {
|
|
325
|
+
return (0, calendar_1.useWorkoutCalendar)();
|
|
326
|
+
}
|
|
327
|
+
getUserSettings() {
|
|
328
|
+
return (0, settings_1.useUserSettings)();
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
})();
|
|
332
|
+
exports.WorkoutListPageService = WorkoutListPageService;
|