incyclist-services 1.5.68 → 1.5.70

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.
@@ -175,7 +175,6 @@ let ActivityRideService = (() => {
175
175
  this.tsPauseStart = undefined;
176
176
  delete this.tsStart;
177
177
  yield (0, utils_1.waitNextTick)();
178
- this.cleanup();
179
178
  delete this.observer;
180
179
  });
181
180
  }
@@ -8,6 +8,7 @@ export declare class GoogleMapsService extends IncyclistService {
8
8
  hasPersonalApiKey(): boolean;
9
9
  onPersonalApiKeySet(): void;
10
10
  getMapsDownloadUrl(): string;
11
+ reload(): void;
11
12
  protected getSecret(key: string): string;
12
13
  protected getSecretBindings(): import("../../api/bindings/secret").ISecretBinding;
13
14
  protected getUserSettings(): import("../../settings").UserSettingsService;
@@ -96,6 +96,10 @@ let GoogleMapsService = (() => {
96
96
  getMapsDownloadUrl() {
97
97
  return MAPS_API_URL;
98
98
  }
99
+ reload() {
100
+ delete this.api;
101
+ this.emit('reload');
102
+ }
99
103
  getSecret(key) {
100
104
  var _a;
101
105
  return (_a = this.getSecretBindings()) === null || _a === void 0 ? void 0 : _a.getSecret(key);
@@ -13,10 +13,13 @@ class FollowRouteDisplayService extends GpxDisplayService_1.GpxDisplayService {
13
13
  return props;
14
14
  }
15
15
  savePosition(startPos) {
16
+ var _a, _b, _c;
16
17
  try {
17
- const { lapDistance } = this.position;
18
- const routeId = this.route.description.id;
19
- this.getUserSettings().set(`routeSelection.followRoute.prevSetting.${routeId}.startPos`, startPos !== null && startPos !== void 0 ? startPos : lapDistance);
18
+ const { lapDistance } = (_a = this.position) !== null && _a !== void 0 ? _a : {};
19
+ const routeId = (_c = (_b = this.route) === null || _b === void 0 ? void 0 : _b.description) === null || _c === void 0 ? void 0 : _c.id;
20
+ if (routeId && lapDistance !== undefined) {
21
+ this.getUserSettings().set(`routeSelection.followRoute.prevSetting.${routeId}.startPos`, startPos !== null && startPos !== void 0 ? startPos : lapDistance);
22
+ }
20
23
  }
21
24
  catch (err) {
22
25
  this.logEvent({ message: 'error', fn: 'savePosition()', position: this.position, error: err.message, stack: err.stack });
@@ -1,3 +1,4 @@
1
+ import { GoogleMapsService } from "../../apps";
1
2
  import { Observer } from "../../base/types";
2
3
  import { UserSettingsService } from "../../settings";
3
4
  import { CurrentRideDisplayProps, GpxDisplayProps } from "../base";
@@ -51,4 +52,5 @@ export declare class GpxDisplayService extends RouteDisplayService {
51
52
  protected getBestCaseUpdateFrequency(): number;
52
53
  protected getNumSetting(key: string): number;
53
54
  protected getUserSettings(): UserSettingsService;
55
+ protected getGoogleMaps(): GoogleMapsService;
54
56
  }
@@ -35,6 +35,7 @@ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn,
35
35
  };
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.GpxDisplayService = void 0;
38
+ const apps_1 = require("../../apps");
38
39
  const decorators_1 = require("../../base/decorators");
39
40
  const types_1 = require("../../base/types");
40
41
  const routes_1 = require("../../routes");
@@ -48,6 +49,7 @@ let GpxDisplayService = (() => {
48
49
  let _classSuper = RouteDisplayService_1.RouteDisplayService;
49
50
  let _instanceExtraInitializers = [];
50
51
  let _getUserSettings_decorators;
52
+ let _getGoogleMaps_decorators;
51
53
  return _a = class GpxDisplayService extends _classSuper {
52
54
  constructor() {
53
55
  super();
@@ -63,6 +65,10 @@ let GpxDisplayService = (() => {
63
65
  const bestFreq = this.getBestCaseUpdateFrequency();
64
66
  this.logEvent({ message: 'init streetview', updateFreq, minimalPause, bestFreq });
65
67
  }
68
+ if (!this.getGoogleMaps().getApi()) {
69
+ this.logEvent({ message: 'reload maps api' });
70
+ this.getGoogleMaps().reload();
71
+ }
66
72
  }
67
73
  catch (err) {
68
74
  this.logError(err, 'initView');
@@ -128,6 +134,7 @@ let GpxDisplayService = (() => {
128
134
  this.mapLoaded = true;
129
135
  }
130
136
  else if (state === 'Error') {
137
+ this.logEvent({ message: 'sat view error', error: this.mapError });
131
138
  this.mapError = error;
132
139
  }
133
140
  this.emit('state-update');
@@ -260,12 +267,17 @@ let GpxDisplayService = (() => {
260
267
  getUserSettings() {
261
268
  return (0, settings_1.useUserSettings)();
262
269
  }
270
+ getGoogleMaps() {
271
+ return (0, apps_1.useGoogleMaps)();
272
+ }
263
273
  },
264
274
  (() => {
265
275
  var _b;
266
276
  const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create((_b = _classSuper[Symbol.metadata]) !== null && _b !== void 0 ? _b : null) : void 0;
267
277
  _getUserSettings_decorators = [decorators_1.Injectable];
278
+ _getGoogleMaps_decorators = [decorators_1.Injectable];
268
279
  __esDecorate(_a, 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);
280
+ __esDecorate(_a, null, _getGoogleMaps_decorators, { kind: "method", name: "getGoogleMaps", static: false, private: false, access: { has: obj => "getGoogleMaps" in obj, get: obj => obj.getGoogleMaps }, metadata: _metadata }, null, _instanceExtraInitializers);
269
281
  if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
270
282
  })(),
271
283
  _a;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incyclist-services",
3
- "version": "1.5.68",
3
+ "version": "1.5.70",
4
4
  "peerDependencies": {
5
5
  "gd-eventlog": "^0.1.26"
6
6
  },