@sumaris-net/ngx-components 1.11.1 → 1.11.2

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.
@@ -18114,9 +18114,10 @@
18114
18114
  return rxjs.of(file);
18115
18115
  })
18116
18116
  .map(function (file$) { return file$.pipe(operators.tap(function (file) { return console.debug("[upload-file] " + file.name + ": uploading..."); }), operators.switchMap(function (file) { return _this.uploadFn(file).pipe(operators.map(function (event) {
18117
- if (event.type === i2$1.HttpEventType.UploadProgress) {
18118
- var total = event.total || file.size;
18119
- file.progress = Math.min(1, event.loaded / total);
18117
+ if ((event === null || event === void 0 ? void 0 : event.type) === i2$1.HttpEventType.UploadProgress || event.type === i2$1.HttpEventType.User) {
18118
+ var total = event.total || 1;
18119
+ var loaded = event.loaded || 0;
18120
+ file.progress = Math.min(1, loaded / total);
18120
18121
  }
18121
18122
  else if (event instanceof i2$1.HttpResponse || event instanceof FileResponse) {
18122
18123
  var content = event.body;
@@ -18125,6 +18126,9 @@
18125
18126
  var message = content.message || event.statusText || 'succeed';
18126
18127
  console.info("[upload-file] " + file.name + ": " + message + " (finalName: " + file.finalName + ")");
18127
18128
  }
18129
+ else {
18130
+ console.warn("[upload-file] " + file.name + ": Unknown event received by uploadFn : ", event);
18131
+ }
18128
18132
  return file;
18129
18133
  }), operators.catchError(function (err) {
18130
18134
  var _a;