@sumaris-net/ngx-components 1.2.2 → 1.2.3

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.
@@ -16874,7 +16874,7 @@
16874
16874
  var location$ = this._downloadingJobs.get(request.uri);
16875
16875
  if (location$)
16876
16876
  return location$;
16877
- request = Object.assign(Object.assign({ visibleInDownloadsUi: true, notificationVisibility: ngx$6.NotificationVisibility.VisibleNotifyCompleted, title: request.title || request.filename }, request), { destinationInExternalFilesDir: Object.assign({ dirType: 'Downloads', subPath: request.filename || request.title || '' }, request.destinationInExternalFilesDir) });
16877
+ request = Object.assign(Object.assign({ visibleInDownloadsUi: true, notificationVisibility: ngx$6.NotificationVisibility.VisibleNotifyCompleted, title: request.title || request.filename }, request), { destinationInExternalPublicDir: Object.assign({ dirType: 'Downloads', subPath: request.filename || request.title || '' }, request.destinationInExternalPublicDir) });
16878
16878
  console.debug('[platform] Downloading, using request: ' + JSON.stringify(request));
16879
16879
  // Start download
16880
16880
  location$ = rxjs.from(this.downloader.download(request));
@@ -21878,34 +21878,25 @@
21878
21878
  };
21879
21879
  AppInstallUpgradeCard.prototype.download = function (event, link) {
21880
21880
  return __awaiter(this, void 0, void 0, function () {
21881
+ var _this = this;
21881
21882
  return __generator(this, function (_a) {
21882
- switch (_a.label) {
21883
- case 0:
21884
- if (!link || !link.url) {
21885
- console.error('[install-upgrade-card] Missing required argument \'link.url\'');
21886
- return [2 /*return*/]; // Skip
21887
- }
21888
- // Mark link as downloading
21889
- link.downloading = true;
21890
- this.markForCheck();
21891
- _a.label = 1;
21892
- case 1:
21893
- _a.trys.push([1, , 3, 4]);
21894
- return [4 /*yield*/, this.listenDownloadJob(link.url, this.platform.download({
21895
- uri: link.url,
21896
- title: link.title,
21897
- filename: link.filename,
21898
- mimeType: link.mimeType
21899
- }))];
21900
- case 2:
21901
- _a.sent();
21902
- return [3 /*break*/, 4];
21903
- case 3:
21904
- link.downloading = false;
21905
- this.markForCheck();
21906
- return [7 /*endfinally*/];
21907
- case 4: return [2 /*return*/];
21883
+ if (!link || !link.url) {
21884
+ console.error('[install-upgrade-card] Missing required argument \'link.url\'');
21885
+ return [2 /*return*/]; // Skip
21908
21886
  }
21887
+ // Mark link as downloading
21888
+ link.downloading = true;
21889
+ this.markForCheck();
21890
+ this.listenDownloadJob(link.url, this.platform.download({
21891
+ uri: link.url,
21892
+ title: link.title,
21893
+ filename: link.filename,
21894
+ mimeType: link.mimeType
21895
+ }))
21896
+ .then(function () { return link.downloading = false; })
21897
+ .catch(function () { return link.downloading = false; })
21898
+ .then(function () { return _this.markForCheck(); });
21899
+ return [2 /*return*/];
21909
21900
  });
21910
21901
  });
21911
21902
  };
@@ -22086,8 +22077,13 @@
22086
22077
  // Listening downloading promise, if exists
22087
22078
  (this.upgradeLinks || []).forEach(function (link) {
22088
22079
  var job = _this.platform.getDownloadingJob(link.url);
22089
- if (job)
22090
- _this.listenDownloadJob(link.url, job);
22080
+ if (job) {
22081
+ link.downloading = true;
22082
+ _this.listenDownloadJob(link.url, job)
22083
+ .then(function () { return link.downloading = false; })
22084
+ .catch(function () { return link.downloading = false; })
22085
+ .then(function () { return _this.markForCheck(); });
22086
+ }
22091
22087
  });
22092
22088
  };
22093
22089
  AppInstallUpgradeCard.prototype.listenDownloadJob = function (url, job) {