incyclist-services 1.7.107 → 1.7.108
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/base/utils/activity.js +2 -1
- package/lib/cjs/activities/list/service.js +2 -0
- package/lib/cjs/routes/library/service.js +6 -0
- package/lib/cjs/routes/page/service.js +1 -1
- package/lib/esm/activities/base/utils/activity.js +2 -1
- package/lib/esm/activities/list/service.js +2 -0
- package/lib/esm/routes/library/service.js +6 -0
- package/lib/esm/routes/page/service.js +1 -1
- package/lib/types/activities/list/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -260,9 +260,10 @@ let Activity = (() => {
|
|
|
260
260
|
}
|
|
261
261
|
getUploadStatus() {
|
|
262
262
|
const uploads = [];
|
|
263
|
+
const stillLoading = !this.details && this.isLoading();
|
|
263
264
|
const services = this.getAppsService().getConnectedServices('ActivityUpload');
|
|
264
265
|
services.forEach(service => {
|
|
265
|
-
let status = 'unknown';
|
|
266
|
+
let status = stillLoading ? 'loading' : 'unknown';
|
|
266
267
|
const info = this.details?.links?.[service.key];
|
|
267
268
|
if (info) {
|
|
268
269
|
status = (info.error || !info.activity_id) ? 'failed' : 'success';
|
|
@@ -258,6 +258,7 @@ let ActivityListService = (() => {
|
|
|
258
258
|
if (!activity) {
|
|
259
259
|
return false;
|
|
260
260
|
}
|
|
261
|
+
await activity.load();
|
|
261
262
|
return new Promise(done => {
|
|
262
263
|
const emitUpdate = async (update) => {
|
|
263
264
|
this.exports = await this.selected.getExports();
|
|
@@ -275,6 +276,7 @@ let ActivityListService = (() => {
|
|
|
275
276
|
if (!activity) {
|
|
276
277
|
return false;
|
|
277
278
|
}
|
|
279
|
+
await activity.load();
|
|
278
280
|
return new Promise(done => {
|
|
279
281
|
const emitUploadUpdate = (update) => {
|
|
280
282
|
if (connectedApp === update.connectedApp) {
|
|
@@ -107,10 +107,14 @@ let RouteLibraryScannerService = (() => {
|
|
|
107
107
|
observer.emit('error', err.message);
|
|
108
108
|
});
|
|
109
109
|
observer.on('success', (route) => {
|
|
110
|
+
if (!this.importProps)
|
|
111
|
+
return;
|
|
110
112
|
this.importProps.phase = 'result';
|
|
111
113
|
this.importProps.resultSuccess = { routeName: route.title };
|
|
112
114
|
});
|
|
113
115
|
observer.on('error', (error) => {
|
|
116
|
+
if (!this.importProps)
|
|
117
|
+
return;
|
|
114
118
|
this.importProps.phase = 'result';
|
|
115
119
|
this.importProps.error = error;
|
|
116
120
|
});
|
|
@@ -200,6 +204,8 @@ let RouteLibraryScannerService = (() => {
|
|
|
200
204
|
async importRoute(fileInfo, observer) {
|
|
201
205
|
await (0, sleep_1.sleep)(0);
|
|
202
206
|
observer.emit('parsing');
|
|
207
|
+
if (!this.importProps)
|
|
208
|
+
return;
|
|
203
209
|
this.importProps.phase = 'parsing';
|
|
204
210
|
if (fileInfo?.ext === 'gpx') {
|
|
205
211
|
return this.importSingleGpxRoute(fileInfo, observer);
|
|
@@ -276,7 +276,7 @@ let RoutesPageService = (() => {
|
|
|
276
276
|
this.importObserver.stop();
|
|
277
277
|
this.getRouteLibraryScanner().done();
|
|
278
278
|
this.importObserver = undefined;
|
|
279
|
-
this.getPageObserver()
|
|
279
|
+
this.getPageObserver()?.emit('import-closed');
|
|
280
280
|
this.serviceState = this.getRouteList().search();
|
|
281
281
|
this.updatePageDisplay();
|
|
282
282
|
}
|
|
@@ -257,9 +257,10 @@ let Activity = (() => {
|
|
|
257
257
|
}
|
|
258
258
|
getUploadStatus() {
|
|
259
259
|
const uploads = [];
|
|
260
|
+
const stillLoading = !this.details && this.isLoading();
|
|
260
261
|
const services = this.getAppsService().getConnectedServices('ActivityUpload');
|
|
261
262
|
services.forEach(service => {
|
|
262
|
-
let status = 'unknown';
|
|
263
|
+
let status = stillLoading ? 'loading' : 'unknown';
|
|
263
264
|
const info = this.details?.links?.[service.key];
|
|
264
265
|
if (info) {
|
|
265
266
|
status = (info.error || !info.activity_id) ? 'failed' : 'success';
|
|
@@ -255,6 +255,7 @@ let ActivityListService = (() => {
|
|
|
255
255
|
if (!activity) {
|
|
256
256
|
return false;
|
|
257
257
|
}
|
|
258
|
+
await activity.load();
|
|
258
259
|
return new Promise(done => {
|
|
259
260
|
const emitUpdate = async (update) => {
|
|
260
261
|
this.exports = await this.selected.getExports();
|
|
@@ -272,6 +273,7 @@ let ActivityListService = (() => {
|
|
|
272
273
|
if (!activity) {
|
|
273
274
|
return false;
|
|
274
275
|
}
|
|
276
|
+
await activity.load();
|
|
275
277
|
return new Promise(done => {
|
|
276
278
|
const emitUploadUpdate = (update) => {
|
|
277
279
|
if (connectedApp === update.connectedApp) {
|
|
@@ -104,10 +104,14 @@ let RouteLibraryScannerService = (() => {
|
|
|
104
104
|
observer.emit('error', err.message);
|
|
105
105
|
});
|
|
106
106
|
observer.on('success', (route) => {
|
|
107
|
+
if (!this.importProps)
|
|
108
|
+
return;
|
|
107
109
|
this.importProps.phase = 'result';
|
|
108
110
|
this.importProps.resultSuccess = { routeName: route.title };
|
|
109
111
|
});
|
|
110
112
|
observer.on('error', (error) => {
|
|
113
|
+
if (!this.importProps)
|
|
114
|
+
return;
|
|
111
115
|
this.importProps.phase = 'result';
|
|
112
116
|
this.importProps.error = error;
|
|
113
117
|
});
|
|
@@ -197,6 +201,8 @@ let RouteLibraryScannerService = (() => {
|
|
|
197
201
|
async importRoute(fileInfo, observer) {
|
|
198
202
|
await sleep(0);
|
|
199
203
|
observer.emit('parsing');
|
|
204
|
+
if (!this.importProps)
|
|
205
|
+
return;
|
|
200
206
|
this.importProps.phase = 'parsing';
|
|
201
207
|
if (fileInfo?.ext === 'gpx') {
|
|
202
208
|
return this.importSingleGpxRoute(fileInfo, observer);
|
|
@@ -273,7 +273,7 @@ let RoutesPageService = (() => {
|
|
|
273
273
|
this.importObserver.stop();
|
|
274
274
|
this.getRouteLibraryScanner().done();
|
|
275
275
|
this.importObserver = undefined;
|
|
276
|
-
this.getPageObserver()
|
|
276
|
+
this.getPageObserver()?.emit('import-closed');
|
|
277
277
|
this.serviceState = this.getRouteList().search();
|
|
278
278
|
this.updatePageDisplay();
|
|
279
279
|
}
|
|
@@ -61,7 +61,7 @@ export type DisplayExportInfo = {
|
|
|
61
61
|
file?: string;
|
|
62
62
|
creating?: boolean;
|
|
63
63
|
};
|
|
64
|
-
export type ActivityUploadStatus = 'success' | 'failed' | 'unknown';
|
|
64
|
+
export type ActivityUploadStatus = 'success' | 'failed' | 'unknown' | 'loading';
|
|
65
65
|
export type DisplayUploadInfo = {
|
|
66
66
|
type: string;
|
|
67
67
|
url?: string;
|