incyclist-services 1.9.39 → 1.9.40

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.
@@ -40,6 +40,7 @@ const observer_1 = require("../../../base/types/observer");
40
40
  const service_1 = require("../base/service");
41
41
  const STEP_CHANGE_AUDIO_KEY = 'preferences.workouts.stepChangeAudioSignal';
42
42
  const CREATE_OVERLAY = 'Create Workout Info';
43
+ const CREATE_CARD_ID = 'Create';
43
44
  const SURFACE = 'workout-details';
44
45
  const DISPLAY_TYPE_KEY = 'preferences.workoutListDisplayType';
45
46
  const DEFAULT_DISPLAY_TYPE = 'tiles';
@@ -154,7 +155,7 @@ let DesktopWorkoutListPageService = (() => {
154
155
  try {
155
156
  const card = this.findSnapshotCard(id);
156
157
  if (!card) {
157
- this.logError(new Error(`card not found: ${id}`), 'onCardOK');
158
+ this.logEvent({ message: 'card not found', id, fn: 'onCardOK' });
158
159
  return;
159
160
  }
160
161
  switch (card.getCardType()) {
@@ -173,12 +174,25 @@ let DesktopWorkoutListPageService = (() => {
173
174
  this.logError(err, 'onCardOK');
174
175
  }
175
176
  }
177
+ onCreateWorkout() {
178
+ try {
179
+ const card = this.findWorkoutCard(CREATE_CARD_ID);
180
+ if (!card) {
181
+ this.logError(new Error('create card not found'), 'onCreateWorkout');
182
+ return;
183
+ }
184
+ this.onCreateCardOK(card);
185
+ }
186
+ catch (err) {
187
+ this.logError(err, 'onCreateWorkout');
188
+ }
189
+ }
176
190
  onCreateInfoClosed(markAsSeen) {
177
191
  try {
178
192
  if (!this.createInfo)
179
193
  return;
180
194
  this.logEvent({ message: 'Overlay closed', overlay: CREATE_OVERLAY, markAsSeen });
181
- const card = this.findSnapshotCard('Create');
195
+ const card = this.findWorkoutCard(CREATE_CARD_ID);
182
196
  if (markAsSeen)
183
197
  card?.markAsSeen();
184
198
  this.createInfo = null;
@@ -37,6 +37,7 @@ import { Observer } from "../../../base/types/observer";
37
37
  import { IMPORT_FILE_EXTENSIONS, WorkoutListPageService } from "../base/service";
38
38
  const STEP_CHANGE_AUDIO_KEY = 'preferences.workouts.stepChangeAudioSignal';
39
39
  const CREATE_OVERLAY = 'Create Workout Info';
40
+ const CREATE_CARD_ID = 'Create';
40
41
  const SURFACE = 'workout-details';
41
42
  const DISPLAY_TYPE_KEY = 'preferences.workoutListDisplayType';
42
43
  const DEFAULT_DISPLAY_TYPE = 'tiles';
@@ -151,7 +152,7 @@ let DesktopWorkoutListPageService = (() => {
151
152
  try {
152
153
  const card = this.findSnapshotCard(id);
153
154
  if (!card) {
154
- this.logError(new Error(`card not found: ${id}`), 'onCardOK');
155
+ this.logEvent({ message: 'card not found', id, fn: 'onCardOK' });
155
156
  return;
156
157
  }
157
158
  switch (card.getCardType()) {
@@ -170,12 +171,25 @@ let DesktopWorkoutListPageService = (() => {
170
171
  this.logError(err, 'onCardOK');
171
172
  }
172
173
  }
174
+ onCreateWorkout() {
175
+ try {
176
+ const card = this.findWorkoutCard(CREATE_CARD_ID);
177
+ if (!card) {
178
+ this.logError(new Error('create card not found'), 'onCreateWorkout');
179
+ return;
180
+ }
181
+ this.onCreateCardOK(card);
182
+ }
183
+ catch (err) {
184
+ this.logError(err, 'onCreateWorkout');
185
+ }
186
+ }
173
187
  onCreateInfoClosed(markAsSeen) {
174
188
  try {
175
189
  if (!this.createInfo)
176
190
  return;
177
191
  this.logEvent({ message: 'Overlay closed', overlay: CREATE_OVERLAY, markAsSeen });
178
- const card = this.findSnapshotCard('Create');
192
+ const card = this.findWorkoutCard(CREATE_CARD_ID);
179
193
  if (markAsSeen)
180
194
  card?.markAsSeen();
181
195
  this.createInfo = null;
@@ -27,6 +27,7 @@ export declare class DesktopWorkoutListPageService extends WorkoutListPageServic
27
27
  getPageDisplayProperties(): DesktopWorkoutListDisplayProps;
28
28
  getWorkoutDetailsProps(id: string): DesktopWorkoutDetailsProps | null;
29
29
  onCardOK(id: string): void;
30
+ onCreateWorkout(): void;
30
31
  onCreateInfoClosed(markAsSeen: boolean): void;
31
32
  onDelete(id: string): Promise<boolean>;
32
33
  onImportFiles(files: WorkoutImportFile | WorkoutImportFile[], source: WorkoutImportSource): void;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "incyclist-services",
3
- "version": "1.9.39",
3
+ "version": "1.9.40",
4
4
  "peerDependencies": {
5
5
  "gd-eventlog": "^0.1.27"
6
6
  },
7
7
  "dependencies": {
8
8
  "@garmin/fitsdk": "^21.222.0",
9
9
  "axios": "^1.21.1",
10
- "incyclist-devices": "^3.0.52",
10
+ "incyclist-devices": "^3.0.53",
11
11
  "promise.any": "^2.0.6",
12
12
  "semver": "^7.8.6",
13
13
  "tcx-builder": "^1.1.1",